communicating between pthreads
hey. i have 2 pthreads running.
one is a thread i have for handling keyboard interrupts. like if i press a 'q', it should message the other thread to stop what its doing, and if i press something else, it sends that char that i pressed to the other thread, where something else is done.
im not very sure how to do this.
while i have tried kill(pid, sig); i havent understood how to receive this signal from the calling thread. i would ideally like to pass some parameters (in this case, the char that was pressed from the thread polling for keyboard interrupts to the other).
how do i pass variables from one thread to another?
thanks in advance.
|