3044 Users online, 8.16 mbps
Quick Search
Already a member?
Username:
Password:
Register Here!





Mutexes to avoid collisions

If you are developing software which accesses hardware via low-level functions, you should use the following Win32 mutexes to avoid collisions with other software.

Right now these Mutexes are used by:

List of Mutexes

  • Motherboard ISA 0×290: Access_ISABUS.HTP.Method
  • Motherboard SMBus: Access_SMBUS.HTP.Method
  • ABIT UGuru: Access_ABIT_UGURU
  • ATI VGA I2C bus: Access_ATI_I2C
  • NVIDIA VGA I2C bus: Access_NV_I2C

Sample code: C / C++

declare:

HANDLE m_mutex;

During initialization of your application:

m_mutex = CreateMutex(NULL, FALSE, _T(EVENT_NAME));

Before you perform any low level operations, lock the event:

WaitForSingleObject(m_mutex,INFINITE);

When you are done, release the lock:

ReleaseMutex(m_mutex);

During application cleanup:

ReleaseMutex(m_mutex);
CloseHandle(m_mutex);

Sample code: Delphi

declare:

Var m_mutex : THandle;

During initialization of your application:

m_mutex := CreateMutex(Nil, False, EVENT_NAME);

Before you perform any low level operations, lock the event:

WaitforSingleObject(m_mutex,INFINITE);

When you are done, release the lock:

ReleaseMutex(m_mutex);

During application cleanup:

ReleaseMutex(m_mutex);
CloseHandle(m_mutex);
 
systool/mutexes_to_avoid_collisions.txt · Acessed 3169 times · Last modified: 2006/09/01 00:00