Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6602099

Browse files
committed
Got rid of florida hack and made it work with Solaris 2.5 pthreads.
Wonder if this will break it on all other platforms :-)
1 parent 3c0b79c commit 6602099

1 file changed

Lines changed: 7 additions & 19 deletions

File tree

Python/thread_pthread.h

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,14 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2222
2323
******************************************************************/
2424

25-
#ifdef sun
26-
#define FLORIDA_HACKS
27-
#endif
28-
29-
#ifdef FLORIDA_HACKS
30-
/* Hacks for Florida State Posix threads implementation */
31-
#undef _POSIX_THREADS
32-
#include "/ufs/guido/src/python/Contrib/pthreads/src/pthread.h"
25+
/* Posix threads interface */
26+
27+
#include <stdlib.h>
28+
#include <pthread.h>
29+
3330
#define pthread_attr_default ((pthread_attr_t *)0)
3431
#define pthread_mutexattr_default ((pthread_mutexattr_t *)0)
3532
#define pthread_condattr_default ((pthread_condattr_t *)0)
36-
#define TRYLOCK_OFFSET 1
37-
#else /* !FLORIDA_HACKS */
38-
#include <pthread.h>
39-
#define TRYLOCK_OFFSET 0
40-
#endif /* FLORIDA_HACKS */
41-
#include <stdlib.h>
4233

4334
/* A pthread mutex isn't sufficient to model the Python lock type
4435
* because, according to Draft 5 of the docs (P1003.4a/D5), both of the
@@ -78,16 +69,13 @@ static void _init_thread _P0()
7869

7970
int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
8071
{
81-
#if defined(SGI_THREADS) && defined(USE_DL)
82-
long addr, size;
83-
static int local_initialized = 0;
84-
#endif /* SGI_THREADS and USE_DL */
8572
pthread_t th;
8673
int success;
8774
dprintf(("start_new_thread called\n"));
8875
if (!initialized)
8976
init_thread();
90-
success = pthread_create(&th, pthread_attr_default, func, arg);
77+
success = pthread_create(&th, pthread_attr_default,
78+
(void* (*) _P((void *)))func, arg);
9179
return success < 0 ? 0 : 1;
9280
}
9381

0 commit comments

Comments
 (0)