Re: [Vala] Vala: Signal from POSIX
- From: Phil Housley <undeconstructed gmail com>
- To: Ervin Orense Balaoro <ierosvin gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Vala: Signal from POSIX
- Date: Mon, 18 Oct 2010 14:13:57 +0100
On 18 October 2010 09:35, Ervin Orense Balaoro <ierosvin gmail com> wrote:
Hello,
I dont know if this is the right place to ask questions regarding vala. But
anyway, ill post the question here just in case someone has the same
experience i had while working with vala using signal from posix.
Code:
public class Check{
...
public int x = 0;
public open(){
...
signal(SIGUSR1, sighandler);
}
...
public void sighandler(int signum) {
stdout.printf("%d", x++);
}
...
}
How do we make our signal handlers access the global variables?
i write a similar code in C, but works okay there.
The callback needed for signal() is a void -> void method, so there is
no way to pass a pointer to your class instance, and so no way for the
callback to invoke the method on the correct instance of the Check
class.
Using a static method and variable should work I assume.
--
Phil Housley
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]