aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/threading
Commit message (Collapse)AuthorAgeFilesLines
* mutex: Use atomics to set current thread in recursive mutexTobias Brunner2014-09-091-9/+12
| | | | | | | | Because this->thread is also read by threads that don't hold the mutex the previous implementation was problematic (especially since pthread_t is an opaque type of unknown length). Fixes #654.
* windows: Remove useless assignment in put_thread()Tobias Brunner2014-07-021-1/+1
|
* windows: Fix parameter name in Doxygen commentTobias Brunner2014-06-301-1/+1
|
* thread-value: Defer cleanup handling to thread termination on WindowsMartin Willi2014-06-173-40/+51
| | | | | | | | | | | Instead of cleaning up all thread-values during destruction, cleanup handler is invoked when a thread detaches. Thread detaching is cough using the Windows DllMain() entry point, and allows us to basically revert 204098a7. Using this mechanism, we make sure that the cleanup handler is invoked by the the correct thread. Further, this mechanism works for externally-spawned threads which run outside of our thread_cb() routine, and works more efficiently with short-running threads.
* windows: Use WINAPI call convention for Windows API callbacksMartin Willi2014-06-061-2/+4
| | | | | For x86_64 it does not actually matter, but for i686 builds the call convention is different with WINAPI.
* windows: Include for Vista instead of defining CondVar/SRWLock functions ourselfMartin Willi2014-06-045-33/+12
|
* thread-value: Immediately cleanup all Windows TLS values on destroyMartin Willi2014-06-043-14/+46
|
* windows: Prevent queueing of multiple thread cancel APCsMartin Willi2014-06-041-4/+13
| | | | | This avoids any races during cleanup invocation if multiple cancel() requests come in.
* windows: Provide a complete native Windows threading backendMartin Willi2014-06-047-0/+1492
|
* 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: Note that tread_cancellation_point temporarily activates cancelabilityMartin Willi2013-11-061-5/+4
|
* Fixed some typosTobias Brunner2013-10-291-1/+1
|
* rwlock: Disable thread cancelability while waiting in (fallback) rwlockMartin Willi2013-10-241-0/+7
| | | | | | An rwlock wait is not a thread cancellation point. As a canceled thread would not have released the mutex, the rwlock would have been left in unusable state.
* rwlock: Don't use buggy pthread_rwlock on OS XMartin Willi2013-10-241-0/+7
| | | | Recursive read locks don't seem to work properly, at least on 10.9.
* semaphore: Support cancellation in wait functions of semaphore fallbackMartin Willi2013-10-231-4/+6
| | | | | Semaphore wait functions should be a thread cancellation point, but did not properly release the mutex in the fallback implementation.
* rwlock: Re-acquire rwlock even if condvar wait times outMartin Willi2013-10-231-1/+1
| | | | | A caller expects that the associated rwlock is held, whether the condvar gets signaled or the wait times out.
* thread: implicitly create thread_t if an external thread calls thread_current()Martin Willi2013-07-181-1/+14
|
* semaphore: similar to thread_create(), semaphore_create() is used by MachMartin Willi2013-05-061-0/+5
| | | | | | The compiler spits no warning, but the wrong symbol is used when calling semaphore_create() from strongSwan. Override the name with a #define to force the use of our semaphore_create().
* 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.
* Use a ./configure check to detect pthread spinlock availabilityMartin Willi2012-12-181-15/+7
| | | | | _POSIX_SPIN_LOCKS does not seem to be defined correctly on all systems (Debian libc 2.3.6). Fixes #262.
* Moved debug.[ch] to utils folderTobias Brunner2012-10-244-4/+4
|
* Moved data structures to new collections subfolderTobias Brunner2012-10-241-1/+1
|
* Use a helper function to add milliseconds to timeval structsTobias Brunner2012-10-182-13/+2
|
* Properly handle thread cancelation in rwlock_condvar_tTobias Brunner2012-09-211-15/+20
|
* Added a condvar implementation that works with rwlock_tTobias Brunner2012-09-212-0/+216
|
* Don't use POSIX semaphores if a MONOTONIC clock is availableMartin Willi2012-08-201-0/+8
| | | | | | POSIX semaphores use CLOCK_REALTIME, but our semaphore_t abstraction expects CLOCK_MONOTONIC based times. Use the mutex/condvar based fallback if time_monotonic() actuall returns monotonic times.
* Add a mutex/condvar based semaphore implementation if sem_timedwait is ↵Martin Willi2012-08-201-2/+67
| | | | | | unavailable Fixes #214.
* Merge branch 'android-app'Tobias Brunner2012-08-131-2/+2
|\ | | | | | | | | | | | | | | This branch introduces a userland IPsec implementation (libipsec) and an Android App which targets the VpnService API that is provided by Android 4+. The implementation is based on the bachelor thesis 'Userland IPsec for Android 4' by Giuliano Grassi and Ralf Sager.
| * 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.
* | If _POSIX_SPIN_LOCKS is defined as -1, it is not availableMartin Willi2012-08-101-0/+4
|/
* Implemented recursive mutex without thread-specific counterTobias Brunner2012-08-031-23/+17
|
* Use a single thread-specific value for our custom rwlock_t implementationTobias Brunner2012-08-031-50/+67
| | | | | | The pthread implementation on Android currently only supports 64 different thread-specific values per process, which we hit easily when every rwlock_t requires one.
* Properly cleanup thread-local values for the threads destroying ↵Tobias Brunner2012-07-121-2/+19
| | | | thread_value_t objects
* Added wrapper for POSIX spin locksTobias Brunner2012-07-042-0/+190
|
* Added recursive read_lock support to our own implementation of rwlock_t.Tobias Brunner2012-05-021-4/+35
|
* Added a wrapper class around POSIX semaphores.Tobias Brunner2012-05-022-0/+191
|
* 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
|
* Migrated mutex_t to INIT/METHOD macros.Tobias Brunner2011-10-031-72/+56
|
* Migrated rwlock_t to INIT/METHOD macros.Tobias Brunner2011-10-031-61/+45
|
* Migrated thread_value_t to INIT/METHOD macros.Tobias Brunner2011-10-031-17/+15
|
* id of non-registered threads defaults to 0Andreas Steffen2011-05-061-1/+18
|
* Option to skip slow addr2line resolution in leak-detectiveMartin Willi2010-05-201-1/+1
|
* We have to rename thread_create on Mac OS X because it conflicts with a syscall.Tobias Brunner2010-04-291-0/+6
|
* 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-063-11/+11
|