@@ -375,23 +375,7 @@ static const char *
375375ThreadInit (
376376 Tcl_Interp * interp /* The current Tcl interpreter */
377377) {
378- /* Tcl 8.7 interps are only supported on 32-bit machines.
379- * Lower than that is never supported. Bye!
380- */
381- #if defined(TCL_WIDE_INT_IS_LONG ) && TCL_MAJOR_VERSION < 9
382- # error "Thread 3.0 is only supported with Tcl 9.0 and higher."
383- # error "Please use Thread 2.8 (branch thread-2-8-branch)"
384- #endif
385-
386- /* Even though it's not supported, Thread 3.0 works with Tcl 8.7
387- * on 32-bit platforms, so allow that for now. It could be that
388- * Tcl 9.0 introduces a further binary incompatibility in the
389- * future, so this is not guaranteed to stay like it is now!
390- */
391- const char * ver = (sizeof (size_t ) == sizeof (int ))? "8.7-" : "9.0" ;
392-
393- if (!((Tcl_InitStubs )(interp , ver , (TCL_MAJOR_VERSION <<8 )|(TCL_MINOR_VERSION <<16 ),
394- TCL_STUB_MAGIC ))) {
378+ if (Tcl_InitStubs (interp , "8.6-" , 0 ) == NULL ) {
395379 return NULL ;
396380 }
397381
@@ -2469,7 +2453,7 @@ ThreadTransfer(
24692453 * Queue the event and poke the other thread's notifier.
24702454 */
24712455
2472- Tcl_ThreadQueueEvent (thrId , (Tcl_Event * )evPtr , TCL_QUEUE_TAIL | TCL_QUEUE_ALERT_IF_EMPTY );
2456+ ThreadQueueEvent (thrId , (Tcl_Event * )evPtr , TCL_QUEUE_TAIL );
24732457
24742458 /*
24752459 * (*) Block until the other thread has either processed the transfer
@@ -2810,9 +2794,9 @@ ThreadSend(
28102794
28112795 eventPtr -> event .proc = ThreadEventProc ;
28122796 if ((flags & THREAD_SEND_HEAD )) {
2813- Tcl_ThreadQueueEvent (thrId , (Tcl_Event * )eventPtr , TCL_QUEUE_HEAD | TCL_QUEUE_ALERT_IF_EMPTY );
2797+ ThreadQueueEvent (thrId , (Tcl_Event * )eventPtr , TCL_QUEUE_HEAD );
28142798 } else {
2815- Tcl_ThreadQueueEvent (thrId , (Tcl_Event * )eventPtr , TCL_QUEUE_TAIL | TCL_QUEUE_ALERT_IF_EMPTY );
2799+ ThreadQueueEvent (thrId , (Tcl_Event * )eventPtr , TCL_QUEUE_TAIL );
28162800 }
28172801
28182802 if ((flags & THREAD_SEND_WAIT ) == 0 ) {
@@ -3015,7 +2999,8 @@ ThreadReserve(
30152999 int operation , /* THREAD_RESERVE | THREAD_RELEASE */
30163000 int wait /* Wait for thread to exit */
30173001) {
3018- int users , dowait = 0 ;
3002+ Tcl_Size users ;
3003+ int dowait = 0 ;
30193004 ThreadEvent * evPtr ;
30203005 ThreadSpecificData * tsdPtr ;
30213006
@@ -3087,7 +3072,7 @@ ThreadReserve(
30873072 evPtr -> clbkData = NULL ;
30883073 evPtr -> resultPtr = resultPtr ;
30893074
3090- Tcl_ThreadQueueEvent (thrId , (Tcl_Event * )evPtr , TCL_QUEUE_TAIL | TCL_QUEUE_ALERT_IF_EMPTY );
3075+ ThreadQueueEvent (thrId , (Tcl_Event * )evPtr , TCL_QUEUE_TAIL );
30913076
30923077 if (dowait ) {
30933078 while (resultPtr -> result == NULL ) {
@@ -3301,12 +3286,12 @@ ThreadSetResult(
33013286 result = "no target interp!" ;
33023287 size = strlen (result );
33033288 resultPtr -> result = (size ) ?
3304- memcpy (Tcl_Alloc (1 + size ), result , 1 + size ) : threadEmptyResult ;
3289+ ( char * ) memcpy (Tcl_Alloc (1 + size ), result , 1 + size ) : threadEmptyResult ;
33053290 } else {
33063291 result = Tcl_GetString (Tcl_GetObjResult (interp ));
33073292 size = Tcl_GetObjResult (interp )-> length ;
33083293 resultPtr -> result = (size ) ?
3309- memcpy (Tcl_Alloc (1 + size ), result , 1 + size ) : threadEmptyResult ;
3294+ ( char * ) memcpy (Tcl_Alloc (1 + size ), result , 1 + size ) : threadEmptyResult ;
33103295 if (code == TCL_ERROR ) {
33113296 errorCode = Tcl_GetVar2 (interp , "errorCode" , NULL , TCL_GLOBAL_ONLY );
33123297 errorInfo = Tcl_GetVar2 (interp , "errorInfo" , NULL , TCL_GLOBAL_ONLY );
@@ -3743,7 +3728,7 @@ ThreadExitProc(
37433728 * because the main thread is going to call free on it.
37443729 */
37453730
3746- resultPtr -> result = strcpy (Tcl_Alloc (1 + strlen (diemsg )), diemsg );
3731+ resultPtr -> result = strcpy (( char * ) Tcl_Alloc (1 + strlen (diemsg )), diemsg );
37473732 resultPtr -> code = TCL_ERROR ;
37483733 resultPtr -> errorCode = resultPtr -> errorInfo = NULL ;
37493734 Tcl_ConditionNotify (& resultPtr -> done );
0 commit comments