dbus_g_thread_init()

Havoc Pennington hp at redhat.com
Thu Sep 14 06:18:42 PDT 2006


frederic heem wrote:
> As for dbus-0.93, the mutex functions return value has been removed and inside 
> the lock and unlock function, there isn't any assert to check the return 
> value of the underlying mutex function. This is definitely a mistake to 
> remove chance to chase hard to find bug.

All the cases you mention are programming errors, not runtime errors. 
The thread implementation could print a warning in these cases, but they 
would all indicate a bug in either dbus or the thread implementation, so 
there is no need to propagate the error indication to the function 
caller, just printing a warning is fine.

This is the difference between g_return_if_fail and GError for example. 
The GError docs talk about it at some length.
http://developer.gnome.org/doc/API/2.0/glib/glib-Error-Reporting.html

> Checking return value for system function such as the mutex one is not an 
> option, it's necessary to produce high quality software.

Unlike something like read(), there are no mutex-related system errors 
that can happen in correct code.

Havoc



More information about the dbus mailing list