DBus threading question

Schmottlach, Glenn glenn.schmottlach at harman.com
Thu Dec 11 10:53:25 PST 2008


In the C++ binding, the "dispatcher.leave()" merely sets a global "exit" flag that's checked in a while loop somewhere else. So, this call is safe from a signal handler. Can you offer any answers to my other questions?

Thanks. . .

-----Original Message-----
From: dbus-bounces at lists.freedesktop.org [mailto:dbus-bounces at lists.freedesktop.org] On Behalf Of Thiago Macieira
Sent: Thursday, December 11, 2008 1:49 PM
To: dbus at lists.freedesktop.org
Subject: Re: DBus threading question

On Thursday 11 December 2008 19:01:25 Schmottlach, Glenn wrote:
> void sigHandler(int sig)
> {
>    dispatcher.leave();
>    gExit = true;
> }
>  

By signal handler, I had meant the function called when you receive a signal 
from D-Bus.

Not Unix signals. You're definitely not allowed to use libdbus-1 from a Unix 
signal handler. There's a very, very small list of system calls that you're 
allowed to do from a signal handler.

Usually, the only operation you can have is to write to a pipe.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Software Engineer - Nokia, Qt Software
  Qt Software is hiring - ask me
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358



More information about the dbus mailing list