Synchronous method: How to "wait" for Notification to occur?
Synchronous method: How to "wait" for Notification to occur?
- Subject: Synchronous method: How to "wait" for Notification to occur?
- From: Rolf <email@hidden>
- Date: Thu, 21 Aug 2003 21:26:16 +0200
Hi all,
A class I have created has a synchronous method which must not return until some asynchronous operation has completed and the result is ready. The asynchronous operation typically takes 20 - 500 mS to complete. The asynchronous operation signals its completion by a Notification.
What's the most elegant way for the method to "wait" for the Notification ? The main RunLoop must be kept active, and the "wait" must not hog CPU time by continually checking if the Notification has arrived. Any good ideas ?
/Rolf
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.