diff options
author | nijtmans <nijtmans> | 2008-07-24 21:54:38 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2008-07-24 21:54:38 (GMT) |
commit | 7f55ab2959b7ec3cac71c72171f20aed26c8f016 (patch) | |
tree | d6af35eba3a72d32359fa5a28abd6fe83823567d /unix | |
parent | 7b1a1c06d6d6cdf4035ef5b35802f85862b27088 (diff) | |
download | tcl-7f55ab2959b7ec3cac71c72171f20aed26c8f016.zip tcl-7f55ab2959b7ec3cac71c72171f20aed26c8f016.tar.gz tcl-7f55ab2959b7ec3cac71c72171f20aed26c8f016.tar.bz2 |
CONSTified 4 functions in the Notifier which all have a Tcl_Time* in it which is
supposed to be a constant, but this was not reflected in the API:
Tcl_SetTimer
Tcl_WaitForEvent
Tcl_ConditionWait
Tcl_SetMaxBlockTime
Introduced a CONST86, so extensions which have their own Notifier
(are there any?) can be modified to compile against both Tcl 8.5
and Tcl 8.6. This change complies with TIP #24
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixNotfy.c | 6 | ||||
-rw-r--r-- | unix/tclUnixThrd.c | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index a763b1d..e285f03 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixNotfy.c,v 1.35 2008/04/16 14:29:26 das Exp $ + * RCS: @(#) $Id: tclUnixNotfy.c,v 1.36 2008/07/24 21:54:42 nijtmans Exp $ */ #include "tclInt.h" @@ -371,7 +371,7 @@ Tcl_AlertNotifier( void Tcl_SetTimer( - Tcl_Time *timePtr) /* Timeout value, may be NULL. */ + const Tcl_Time *timePtr) /* Timeout value, may be NULL. */ { if (tclNotifierHooks.setTimerProc) { tclNotifierHooks.setTimerProc(timePtr); @@ -669,7 +669,7 @@ FileHandlerEventProc( int Tcl_WaitForEvent( - Tcl_Time *timePtr) /* Maximum block time, or NULL. */ + const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { if (tclNotifierHooks.waitForEventProc) { return tclNotifierHooks.waitForEventProc(timePtr); diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 63e8733..d122f41 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixThrd.c,v 1.58 2008/05/09 04:58:54 georgeps Exp $ + * RCS: @(#) $Id: tclUnixThrd.c,v 1.59 2008/07/24 21:54:42 nijtmans Exp $ */ #include "tclInt.h" @@ -224,13 +224,13 @@ TclpThreadGetStackSize(void) #if defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && defined(TclpPthreadGetAttrs) pthread_attr_t threadAttr; /* This will hold the thread attributes for * the current thread. */ -#ifdef __GLIBC__ +#ifdef __GLIBC__ /* * Fix for [Bug 1815573] * * DESCRIPTION: * On linux TclpPthreadGetAttrs (which is pthread_attr_get_np) may return - * bogus values on the initial thread. + * bogus values on the initial thread. * * ASSUMPTIONS: * There seems to be no api to determine if we are on the initial @@ -268,7 +268,7 @@ TclpThreadGetStackSize(void) } } - + if (pthread_attr_getstacksize(&threadAttr, &stackSize) != 0) { pthread_attr_destroy(&threadAttr); return (size_t)-1; @@ -279,7 +279,7 @@ TclpThreadGetStackSize(void) /* * On Darwin, the API below does not return the correct stack size for the * main thread (which is not a real pthread), so fallback to getrlimit(). - */ + */ if (!pthread_main_np()) #endif stackSize = pthread_get_stacksize_np(pthread_self()); @@ -617,7 +617,7 @@ void Tcl_ConditionWait( Tcl_Condition *condPtr, /* Really (pthread_cond_t **) */ Tcl_Mutex *mutexPtr, /* Really (pthread_mutex_t **) */ - Tcl_Time *timePtr) /* Timeout on waiting period */ + const Tcl_Time *timePtr) /* Timeout on waiting period */ { pthread_cond_t *pcondPtr; pthread_mutex_t *pmutexPtr; @@ -882,7 +882,7 @@ void TclpThreadDeleteKey(void *keyPtr) { void TclpThreadSetMasterTSD(void *tsdKeyPtr, void *ptr) { pthread_key_t *key = tsdKeyPtr; - + if (pthread_setspecific(*key, ptr)) { Tcl_Panic("unable to set master TSD value"); } |