mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-19 11:10:33 +01:00
win32 fix: Keep server autolaunch mutex settings according to client detection algorithmus.
This commit is contained in:
parent
636a9a29f8
commit
e2f94ea14f
1 changed files with 12 additions and 0 deletions
|
|
@ -2639,6 +2639,10 @@ _dbus_daemon_is_session_bus_address_published (const char *scope)
|
|||
// see http://msdn.microsoft.com/en-us/library/ms684315%28VS.85%29.aspx
|
||||
hDBusDaemonMutex = CreateMutexA( NULL, FALSE, _dbus_string_get_const_data(&mutex_name) );
|
||||
|
||||
/* The client uses mutex ownership to detect a running server, so the server should do so too.
|
||||
Fortunally the client deletes the mutex in the lock protected area, so checking presence
|
||||
will work too. */
|
||||
|
||||
_dbus_global_unlock( lock );
|
||||
|
||||
_dbus_string_free( &mutex_name );
|
||||
|
|
@ -2684,6 +2688,14 @@ _dbus_daemon_publish_session_bus_address (const char* address, const char *scope
|
|||
}
|
||||
_dbus_string_free( &mutex_name );
|
||||
|
||||
// acquire the mutex
|
||||
if (WaitForSingleObject( hDBusDaemonMutex, 10 ) != WAIT_OBJECT_0)
|
||||
{
|
||||
_dbus_global_unlock( lock );
|
||||
CloseHandle( hDBusDaemonMutex );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!_dbus_get_shm_name(&shm_name,scope))
|
||||
{
|
||||
_dbus_string_free( &shm_name );
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue