Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Delayed Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Delayed Events



I originally developed an application in Jaguar (using GCC) that used events and threads. I had the event working so it would wait for an event for a period of time, and if it did not receive it, it would return false.

wait_ret = pthread_cond_timedwait(&_eventId, &count_mutex, &tv);

The thread could be released by another thread as follows

pthread_mutex_lock(&count_mutex);
pthread_cond_signal(&_eventId);
pthread_mutex_unlock(&count_mutex);

This all worked fine until I upgraded to Panther. Now what happens is that the thread that is waiting for the event does not continue immediately after receiving the event.

For example, if I had the thread wait for 2 seconds for the event and had the other thread set the event after half a second, the thread that waited for the event does not continue immediately. The call to pthread_cond_timedwait, however, returns successful.

My code is compiled as part of a JNI library being called by a Java GUI

Any suggestions?

--
Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page


http://www.users.bigpond.com/angelo_f/

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
   Bernard of Clairvaux (1090 - 1153)



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mt-smp mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.