@@ -375,25 +375,15 @@ 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+ #ifdef USE_TCL_STUBS
379+ if (Tcl_InitStubs (interp , TCL_VERSION , 0 ) == NULL ) {
395380 return NULL ;
396381 }
382+ #else
383+ if (Tcl_PkgRequire (interp , "Tcl" , TCL_VERSION , 0 ) == NULL ) {
384+ return NULL ;
385+ }
386+ #endif
397387
398388 if (threadMutex == NULL ){
399389 Tcl_MutexLock (& threadMutex );
@@ -2469,7 +2459,7 @@ ThreadTransfer(
24692459 * Queue the event and poke the other thread's notifier.
24702460 */
24712461
2472- Tcl_ThreadQueueEvent (thrId , (Tcl_Event * )evPtr , TCL_QUEUE_TAIL | TCL_QUEUE_ALERT_IF_EMPTY );
2462+ ThreadQueueEvent (thrId , (Tcl_Event * )evPtr , TCL_QUEUE_TAIL );
24732463
24742464 /*
24752465 * (*) Block until the other thread has either processed the transfer
@@ -2810,9 +2800,9 @@ ThreadSend(
28102800
28112801 eventPtr -> event .proc = ThreadEventProc ;
28122802 if ((flags & THREAD_SEND_HEAD )) {
2813- Tcl_ThreadQueueEvent (thrId , (Tcl_Event * )eventPtr , TCL_QUEUE_HEAD | TCL_QUEUE_ALERT_IF_EMPTY );
2803+ ThreadQueueEvent (thrId , (Tcl_Event * )eventPtr , TCL_QUEUE_HEAD );
28142804 } else {
2815- Tcl_ThreadQueueEvent (thrId , (Tcl_Event * )eventPtr , TCL_QUEUE_TAIL | TCL_QUEUE_ALERT_IF_EMPTY );
2805+ ThreadQueueEvent (thrId , (Tcl_Event * )eventPtr , TCL_QUEUE_TAIL );
28162806 }
28172807
28182808 if ((flags & THREAD_SEND_WAIT ) == 0 ) {
@@ -3087,7 +3077,7 @@ ThreadReserve(
30873077 evPtr -> clbkData = NULL ;
30883078 evPtr -> resultPtr = resultPtr ;
30893079
3090- Tcl_ThreadQueueEvent (thrId , (Tcl_Event * )evPtr , TCL_QUEUE_TAIL | TCL_QUEUE_ALERT_IF_EMPTY );
3080+ ThreadQueueEvent (thrId , (Tcl_Event * )evPtr , TCL_QUEUE_TAIL );
30913081
30923082 if (dowait ) {
30933083 while (resultPtr -> result == NULL ) {
0 commit comments