pthread is causing my program to ignore signals

Mar 22, 2016 at 8:42pm
I'm working on a program that is causing an alignment exception when I try to use std::thread. After switching to pthread, I also realized that when the threads were running, any input from the keyboard was ignored. This obviously causes problems when the program tries to run away from me and I can no longer send SIGINT with ctrl-c. I'm really stuck on this one. I've tried a few different signal handlers sigset() and signal(). Nothing will kill the program except turning the Pi off.

Another weird issue. I'm using wiringPi to try to read some input from some buttons, but I'm not getting the values correctly. digitalRead() returns 1 or 0 regardless of whether or not I press the button, and I did use pinMode() to set the pins to input.

I've spent way too much time trying to fix this. I'm feeling desperate.
Last edited on Mar 22, 2016 at 8:43pm
Mar 27, 2016 at 5:19pm
if your program have many threads, any of them can read keyboard input.
I think you have mistake somewhere else.
Mar 29, 2016 at 8:43pm
The mistake was actually that I was using the wrong pin diagram. Apparently setting a pin to input when it's being used for other things causes the Pi to start ignoring keyboard input. I have no idea why.
Topic archived. No new replies allowed.