aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/threading/thread.c
Commit message (Collapse)AuthorAgeFilesLines
* thread: Don't hold mutex when calling cleanup handlers while terminatingTobias Brunner2016-04-131-12/+14
| | | | | | | | | | This could interfere with cleanup handlers that try to acquire mutexes while other threads holding these try to e.g. cancel the threads. As cleanup handlers are only queued by the threads themselves we don't need any synchronization to access the list. Fixes #1401.
* thread: Allow thread ID to be value returned by gettid()Thomas Egerer2016-03-041-11/+23
| | | | Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
* thread: Add a function to pop and call all registered cleanup handlersMartin Willi2015-04-151-0/+17
|
* thread: Don't acquire lock for thread_cleanup_push/popMartin Willi2015-04-151-5/+0
| | | | | This is called only by the thread for its own thread_t, and does not need synchronization.
* thread: Remove unneeded thread startup synchronizationMartin Willi2015-04-131-13/+4
| | | | | | | | | | | sem_init() is deprecated on OS X, and it actually fails with ENOSYS. Using our wrapped semaphore object is not an option, as it relies on the thread cleanup that we can't rely on at this stage. It is unclear why startup synchronization is required, as we can allocate the thread ID just before creating the pthread. There is a chance that we allocate a thread ID for a thread that fails to create, but the risk and consequences are negligible.
* thread: Add a Windows pthread variant to print thread identifiersMartin Willi2014-06-031-0/+3
|
* thread: Properly clean up meta data of main threadTobias Brunner2014-03-071-0/+2
|
* thread: implicitly create thread_t if an external thread calls thread_current()Martin Willi2013-07-181-1/+14
|
* Use SIGUSR2 for SIG_CANCEL on AndroidTobias Brunner2013-02-261-0/+4
| | | | | | | | | | SIGRTMIN is defined as 32 while sigset_t is defined as unsigned long (i.e. holds 32 signals). Hence, the signal could never be blocked. Sending the signal still canceled threads, but sometimes in situations where they shouldn't have been canceled (e.g. while holding a lock). Fixes #298.
* Moved debug.[ch] to utils folderTobias Brunner2012-10-241-1/+1
|
* Moved data structures to new collections subfolderTobias Brunner2012-10-241-1/+1
|
* Ensure thread IDs always start with 1 even if the library is reusedTobias Brunner2012-08-131-2/+2
| | | | | | Within the Android App the library stays loaded in memory and is just initialized/deinitialized with each connection, the static thread counter would continuously increase without this patch.
* Fix gettid() on Android, which is defined in unistd.h there.Tobias Brunner2012-01-121-3/+4
|
* Use native gettid() if available (which is the case on Android).Tobias Brunner2012-01-101-3/+11
|
* Log native thread ID when a thread is created.Tobias Brunner2011-12-161-1/+16
| | | | | If possible gettid() is used, otherwise pthread_self() is logged (which is not completely portable, but seems to work on most supported platforms).
* Create a dummy pthread key for value "0", as some buggy PKCS#11 libraries ↵Martin Willi2011-12-071-0/+10
| | | | mangle it
* Migrated thread_t to INIT/METHOD macros.Tobias Brunner2011-10-031-34/+26
|
* id of non-registered threads defaults to 0Andreas Steffen2011-05-061-1/+18
|
* The mutex of a thread has to be locked when destroying it.Tobias Brunner2010-04-291-0/+2
|
* Adding DBG_LIB to all calls of libstrongswan's version of DBG*.Tobias Brunner2010-04-061-6/+6
|
* corrected captionsAndreas Steffen2010-02-011-2/+2
|
* Added a workaround for the missing pthread_cancel on Android.Tobias Brunner2009-12-231-0/+35
|
* Adding an object-oriented wrapper for threads.Tobias Brunner2009-12-231-0/+405