c++ - How to check the state of signal in Qt? -


the following win32 code checks if event signaled or not without waiting on it.

handle = createevent(null, true, false, null);  bool signaled = waitforsingleobjectex(handle, 0, true) != wait_timeout; 

what equivalent in qt?

what trying accomplish:

i have 2 threads listener , sender (which sends commands). when user clicks button, operations sends series of commands need verify response first command received (and examine it) before send following command. thought synchronize them around mutex or something..the receiver signal mutex when data received , send can wait on it. looking convenient way in qt accomplish this. using qtcpserver derived class , listen() method listen on port.

there none, because signals stateless concept. in qt, signal function call. there's no concept of signal being "signaled". signal "being signaled" 1 method call hasn't returned yet - recall signals methods moc-generated code.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -