[Openal-devel] suggested threadlib simplification
Prakash Punnoor
prakash at punnoor.de
Sat Oct 28 03:31:37 PDT 2006
Hi,
is following OK? This simplifies code and gets rid of a compiler warning:
Index: src/al_threadlib.c
===================================================================
--- src/al_threadlib.c (Revision 1394)
+++ src/al_threadlib.c (Arbeitskopie)
@@ -10,20 +10,6 @@
#if defined(USE_POSIXTHREADING)
-typedef int ( *ptfunc ) ( void * );
-
-static void *runThread( void *data ) AL_ATTRIBUTE_NORETURN_;
-
-static void *runThread( void *data )
-{
- ptfunc fn = ( ptfunc ) data;
- fn( NULL );
- pthread_exit( NULL );
-#ifndef HAVE___ATTRIBUTE__
- return NULL;
-#endif
-}
-
ThreadID _alCreateThread( int ( *fn ) ( void * ) )
{
pthread_attr_t type;
@@ -39,7 +25,7 @@
pthread_attr_setdetachstate( &type, PTHREAD_CREATE_JOINABLE );
- if( pthread_create( thread, &type, runThread, ( void * ) fn ) != 0 ) {
+ if( pthread_create( thread, &type, (void* (*) ( void * ))fn, NULL ) !=
0 ) {
free( thread );
return NULL;
}
--
(°= =°)
//\ Prakash Punnoor /\\
V_/ \_V
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal-devel/attachments/20061028/3a1e21f3/attachment.bin
More information about the Openal-devel
mailing list