| Framework | Frameworks/QuickTime.framework |
| Declared in | QTML.h |
Apple provides a small set of utility functions that are used for developing QuickTime applications in the Windows environment.
Creates a synchronization object to facilitate mutually exclusive access to a Windows data structure.
QTMLMutex QTMLCreateMutex ( void );
This function creates a mutex object for guarded access to data structures and routines that require mutually exclusive access. In a multithreaded preemptive environment, such as Windows NT, you can use the various mutex utility functions such as QTMLGrabMutex to protect a shared resource from simultaneous access by multiple threads or processes. Mutex objects are used throughout QTML to provide such protection.
Introduced in QuickTime 3 or earlier.
QTML.hDeallocates a synchronization object created by QTMLCreateMutex.
void QTMLDestroyMutex ( QTMLMutex mu );
A mutex object.
Call this function to deallocate the mutex object created by QTMLCreateMutex.
Introduced in QuickTime 3 or earlier.
QTML.hConfers ownership of a mutex created by QTMLCreateMutex.
void QTMLGrabMutex ( QTMLMutex mu );
A mutex object.
Call this function when you require exclusive ownership of the resource guarded by a mutex. This function will return when you have gained this ownership. In the case where another thread or process holds the mutex, this function waits until that process or thread relinquishes control. If you need to determine if you can grab the mutex, without actually grabbing it, call QTMLTryGrabMutex.
Introduced in QuickTime 3 or earlier.
QTML.hReleases ownership of a QTMLMutex object.
void QTMLReturnMutex ( QTMLMutex mu );
A mutex object.
Call this function to balance a call to QTMLGrabMutex when you are ready to relinquish control of the mutex and corresponding shared resource. By making this call, you allow other processes or threads waiting for the release of this mutex to gain access.
Introduced in QuickTime 3 or earlier.
QTML.hDetermines if you would be able to get immediate ownership of a mutex created by QTMLCreateMutex.
Boolean QTMLTryGrabMutex ( QTMLMutex mu );
A mutex object.
Returns TRUE if you are able to immediately grab the mutex, via the QTMLGrabMutex call, without having to wait.
Call this function when you need to preflight a QTMLGrabMutex call.
Under normal circumstances you should not need to make this call.
Introduced in QuickTime 4.
QTML.hYields time to other threads while your code is in a tight loop.
void QTMLYieldCPU ( void );
Use this function from within tight loops to yield time to other threads. Using this function is similar to calling SystemTask from within a Macintosh event loop.
Introduced in QuickTime 3 or earlier.
QTML.hYields time to other threads and specifies the sleep time while in a tight loop.
void QTMLYieldCPUTime ( long milliSeconds, unsigned long flags );
Number of milliseconds to sleep before returning to the caller.
A flag (see below) that specifies an option for this function. See these constants:
kQTMLHandlePortEvents
Use this function from within tight loops to yield time to other threads.
This function differs from QTMLYieldCPU in that you can specify the time to sleep as well as optionally have QTML process Win32 messages while waiting for the yield time to expire.
Introduced in QuickTime 3 or earlier.
QTML.h
Represents a type used by the Windows API API.
typedef long QTMLMutex;
QTML.h
Constants passed to QTMLYieldCPUTime.
enum {
kQTMLHandlePortEvents = (1L << 0) /* ask for event handling during the yield*/
};
QTML.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)