Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Event signalling state Dll/static library

So I have a library available as a static or a DLL.

As part if the initialization it creates some events and a background worker thread...

WorkEvth = CreateEvent(NULL,0,0,TEXT("SOME_WORK_EVENT"));
...
_beginthread(MyWorkerThread,4096,(void *)NULL)

The worker thread has...

for(;;)
{
WaitForSingleObject(WorkEvth ,INFINITE);
/* do stuff */
}

Now there appears to be a difference if an application links using the static version of uses the DLL. In the DLL the event appears to be already signalled the first time the worker waits, but in the static version the worker will wait for a 'real' event.

Any thoughts?

Sign In or Register to comment.