8 #define MAGICKCORE_IMPLEMENTATION 1
9 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
18 #if defined(MAGICKCORE_HAVE_PTHREAD)
22 ::pthread_mutexattr_t attr;
24 if ( (sysError = ::pthread_mutexattr_init( &attr )) == 0 )
25 if ( (sysError = ::pthread_mutex_init( &_mutex, &attr )) == 0 )
27 ::pthread_mutexattr_destroy( &attr );
34 #if defined(_VISUALC_) && defined(_MT)
38 SECURITY_ATTRIBUTES security;
41 security.nLength =
sizeof(security);
42 security.lpSecurityDescriptor = NULL;
43 security.bInheritHandle = TRUE;
46 _mutex.id = ::CreateSemaphore(&security, 1, MAXSEMLEN, NULL);
47 if ( _mutex.id != NULL )
61 #if defined(MAGICKCORE_HAVE_PTHREAD)
63 if ( (sysError = ::pthread_mutex_destroy( &_mutex )) == 0 )
68 #if defined(_MT) && defined(_VISUALC_)
69 if ( ::CloseHandle(_mutex.id) != 0 )
78 #if defined(MAGICKCORE_HAVE_PTHREAD)
80 if ( (sysError = ::pthread_mutex_lock( &_mutex )) == 0)
85 #if defined(_MT) && defined(_VISUALC_)
86 if (WaitForSingleObject(_mutex.id,INFINITE) != WAIT_FAILED)
95 #if defined(MAGICKCORE_HAVE_PTHREAD)
97 if ( (sysError = ::pthread_mutex_unlock( &_mutex )) == 0)
100 strerror(sysError) );
102 #if defined(_MT) && defined(_VISUALC_)
103 if ( ReleaseSemaphore(_mutex.id, 1, NULL) == TRUE )
MagickPPExport void throwExceptionExplicit(const MagickCore::ExceptionType severity_, const char *reason_, const char *description_=(char *) NULL)