Lines Matching +full:unused +full:- +full:but +full:- +full:set +full:- +full:variable
56 /* bpo-38852: test_threading.test_recursion_limit() checks that 1000 recursive
57 Python calls (default recursion limit) doesn't crash, but raise a regular
74 #error "THREAD_STACK_SIZE defined but _POSIX_THREAD_ATTR_STACKSIZE undefined"
84 #if (_POSIX_SEMAPHORES+0) == -1
165 abs->tv_sec += us / 1000000; in _PyThread_cond_after()
166 abs->tv_nsec += (us % 1000000) * 1000; in _PyThread_cond_after()
167 abs->tv_sec += abs->tv_nsec / 1000000000; in _PyThread_cond_after()
168 abs->tv_nsec %= 1000000000; in _PyThread_cond_after()
182 * -> a thread tries to lock a mutex it already has locked
183 * -> a thread tries to unlock a mutex locked by a different thread
222 /* bpo-33015: pythread_callback struct and pythread_wrapper() cast
237 void (*func)(void *) = callback->func; in pythread_wrapper()
238 void *func_arg = callback->arg; in pythread_wrapper()
267 size_t stacksize = tstate ? tstate->interp->threads.stacksize : 0; in PyThread_start_new_thread()
286 callback->func = func; in PyThread_start_new_thread()
287 callback->arg = arg; in PyThread_start_new_thread()
317 - It does not guarantee the promise that a non-zero integer is returned.
318 - The cast to unsigned long is inherently unsafe.
319 - It is not clear that the 'volatile' (for AIX?) are any longer necessary.
397 dprintf(("PyThread_allocate_lock() -> %p\n", (void *)lock)); in PyThread_allocate_lock()
407 (void) error; /* silence unused-but-set-variable warning */ in PyThread_free_lock()
422 * Correct implementations return -1 and put the code in errno. This supports
428 return (status == -1) ? errno : status; in fix_status()
439 (void) error; /* silence unused-but-set-variable warning */ in PyThread_acquire_lock_timed()
450 // bpo-41710: PyThread_acquire_lock_timed() cannot report timeout in PyThread_acquire_lock_timed()
463 timeout = _PyTime_FromNanoseconds(-1); in PyThread_acquire_lock_timed()
549 dprintf(("PyThread_acquire_lock_timed(%p, %lld, %d) -> %d\n", in PyThread_acquire_lock_timed()
560 (void) error; /* silence unused-but-set-variable warning */ in PyThread_release_lock()
584 lock->locked = 0; in PyThread_allocate_lock()
586 status = pthread_mutex_init(&lock->mut, NULL); in PyThread_allocate_lock()
589 pure happens-before. We can't simply mark the in PyThread_allocate_lock()
590 Python-level mutex as a mutex because it can be in PyThread_allocate_lock()
593 _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(&lock->mut); in PyThread_allocate_lock()
595 status = _PyThread_cond_init(&lock->lock_released); in PyThread_allocate_lock()
604 dprintf(("PyThread_allocate_lock() -> %p\n", (void *)lock)); in PyThread_allocate_lock()
614 (void) error; /* silence unused-but-set-variable warning */ in PyThread_free_lock()
617 /* some pthread-like implementations tie the mutex to the cond in PyThread_free_lock()
620 status = pthread_cond_destroy( &thelock->lock_released ); in PyThread_free_lock()
623 status = pthread_mutex_destroy( &thelock->mut ); in PyThread_free_lock()
641 status = pthread_mutex_trylock( &thelock->mut ); in PyThread_acquire_lock_timed()
646 status = pthread_mutex_lock( &thelock->mut ); in PyThread_acquire_lock_timed()
650 if (thelock->locked == 0) { in PyThread_acquire_lock_timed()
660 /* mut must be locked by me -- part of the condition in PyThread_acquire_lock_timed()
665 &thelock->lock_released, in PyThread_acquire_lock_timed()
666 &thelock->mut, &abs); in PyThread_acquire_lock_timed()
676 &thelock->lock_released, in PyThread_acquire_lock_timed()
677 &thelock->mut); in PyThread_acquire_lock_timed()
681 if (intr_flag && status == 0 && thelock->locked) { in PyThread_acquire_lock_timed()
682 /* We were woken up, but didn't get the lock. We probably received in PyThread_acquire_lock_timed()
688 else if (status == 0 && !thelock->locked) { in PyThread_acquire_lock_timed()
693 if (success == PY_LOCK_ACQUIRED) thelock->locked = 1; in PyThread_acquire_lock_timed()
694 status = pthread_mutex_unlock( &thelock->mut ); in PyThread_acquire_lock_timed()
699 dprintf(("PyThread_acquire_lock_timed(%p, %lld, %d) -> %d\n", in PyThread_acquire_lock_timed()
710 (void) error; /* silence unused-but-set-variable warning */ in PyThread_release_lock()
713 status = pthread_mutex_lock( &thelock->mut ); in PyThread_release_lock()
716 thelock->locked = 0; in PyThread_release_lock()
719 status = pthread_cond_signal( &thelock->lock_released ); in PyThread_release_lock()
722 status = pthread_mutex_unlock( &thelock->mut ); in PyThread_release_lock()
733 return -1; in _PyThread_at_fork_reinit()
736 /* bpo-6721, bpo-40089: The old lock can be in an inconsistent state. in _PyThread_at_fork_reinit()
751 return PyThread_acquire_lock_timed(lock, waitflag ? -1 : 0, /*intr_flag=*/0); in PyThread_acquire_lock()
754 /* set the thread stack size.
755 * Return 0 if size is valid, -1 if size is invalid,
756 * -2 if setting stack size is not supported.
767 /* set to default */ in _pythread_pthread_set_stacksize()
769 _PyInterpreterState_GET()->threads.stacksize = 0; in _pythread_pthread_set_stacksize()
786 _PyInterpreterState_GET()->threads.stacksize = size; in _pythread_pthread_set_stacksize()
791 return -1; in _pythread_pthread_set_stacksize()
793 return -2; in _pythread_pthread_set_stacksize()
807 failure status and other TLS functions all are no-ops. This indicates
822 return -1; in PyThread_create_key()
827 return -1; in PyThread_create_key()
831 return -1; /* never return valid key value. */ in PyThread_create_key()
856 return fail ? -1 : 0; in PyThread_set_key_value()
858 return -1; in PyThread_set_key_value()
881 Platform-specific components of TSS API implementation.
889 if (key->_is_initialized) { in PyThread_tss_create()
893 int fail = pthread_key_create(&(key->_key), NULL); in PyThread_tss_create()
895 return -1; in PyThread_tss_create()
897 key->_is_initialized = 1; in PyThread_tss_create()
906 if (!key->_is_initialized) { in PyThread_tss_delete()
910 pthread_key_delete(key->_key); in PyThread_tss_delete()
912 key->_is_initialized = 0; in PyThread_tss_delete()
919 int fail = pthread_setspecific(key->_key, value); in PyThread_tss_set()
920 return fail ? -1 : 0; in PyThread_tss_set()
927 return pthread_getspecific(key->_key); in PyThread_tss_get()