Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | mutex: Use atomics to set current thread in recursive mutex | Tobias Brunner | 2014-09-09 | 1 | -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 Brunner | 2014-07-02 | 1 | -1/+1 |
| | |||||
* | windows: Fix parameter name in Doxygen comment | Tobias Brunner | 2014-06-30 | 1 | -1/+1 |
| | |||||
* | thread-value: Defer cleanup handling to thread termination on Windows | Martin Willi | 2014-06-17 | 3 | -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 callbacks | Martin Willi | 2014-06-06 | 1 | -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 ourself | Martin Willi | 2014-06-04 | 5 | -33/+12 |
| | |||||
* | thread-value: Immediately cleanup all Windows TLS values on destroy | Martin Willi | 2014-06-04 | 3 | -14/+46 |
| | |||||
* | windows: Prevent queueing of multiple thread cancel APCs | Martin Willi | 2014-06-04 | 1 | -4/+13 |
| | | | | | This avoids any races during cleanup invocation if multiple cancel() requests come in. | ||||
* | windows: Provide a complete native Windows threading backend | Martin Willi | 2014-06-04 | 7 | -0/+1492 |
| | |||||
* | thread: Add a Windows pthread variant to print thread identifiers | Martin Willi | 2014-06-03 | 1 | -0/+3 |
| | |||||
* | thread: Properly clean up meta data of main thread | Tobias Brunner | 2014-03-07 | 1 | -0/+2 |
| | |||||
* | thread: Note that tread_cancellation_point temporarily activates cancelability | Martin Willi | 2013-11-06 | 1 | -5/+4 |
| | |||||
* | Fixed some typos | Tobias Brunner | 2013-10-29 | 1 | -1/+1 |
| | |||||
* | rwlock: Disable thread cancelability while waiting in (fallback) rwlock | Martin Willi | 2013-10-24 | 1 | -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 X | Martin Willi | 2013-10-24 | 1 | -0/+7 |
| | | | | Recursive read locks don't seem to work properly, at least on 10.9. | ||||
* | semaphore: Support cancellation in wait functions of semaphore fallback | Martin Willi | 2013-10-23 | 1 | -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 out | Martin Willi | 2013-10-23 | 1 | -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 Willi | 2013-07-18 | 1 | -1/+14 |
| | |||||
* | semaphore: similar to thread_create(), semaphore_create() is used by Mach | Martin Willi | 2013-05-06 | 1 | -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 Android | Tobias Brunner | 2013-02-26 | 1 | -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 availability | Martin Willi | 2012-12-18 | 1 | -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 folder | Tobias Brunner | 2012-10-24 | 4 | -4/+4 |
| | |||||
* | Moved data structures to new collections subfolder | Tobias Brunner | 2012-10-24 | 1 | -1/+1 |
| | |||||
* | Use a helper function to add milliseconds to timeval structs | Tobias Brunner | 2012-10-18 | 2 | -13/+2 |
| | |||||
* | Properly handle thread cancelation in rwlock_condvar_t | Tobias Brunner | 2012-09-21 | 1 | -15/+20 |
| | |||||
* | Added a condvar implementation that works with rwlock_t | Tobias Brunner | 2012-09-21 | 2 | -0/+216 |
| | |||||
* | Don't use POSIX semaphores if a MONOTONIC clock is available | Martin Willi | 2012-08-20 | 1 | -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 Willi | 2012-08-20 | 1 | -2/+67 |
| | | | | | | unavailable Fixes #214. | ||||
* | Merge branch 'android-app' | Tobias Brunner | 2012-08-13 | 1 | -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 reused | Tobias Brunner | 2012-08-13 | 1 | -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 available | Martin Willi | 2012-08-10 | 1 | -0/+4 |
|/ | |||||
* | Implemented recursive mutex without thread-specific counter | Tobias Brunner | 2012-08-03 | 1 | -23/+17 |
| | |||||
* | Use a single thread-specific value for our custom rwlock_t implementation | Tobias Brunner | 2012-08-03 | 1 | -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 Brunner | 2012-07-12 | 1 | -2/+19 |
| | | | | thread_value_t objects | ||||
* | Added wrapper for POSIX spin locks | Tobias Brunner | 2012-07-04 | 2 | -0/+190 |
| | |||||
* | Added recursive read_lock support to our own implementation of rwlock_t. | Tobias Brunner | 2012-05-02 | 1 | -4/+35 |
| | |||||
* | Added a wrapper class around POSIX semaphores. | Tobias Brunner | 2012-05-02 | 2 | -0/+191 |
| | |||||
* | Fix gettid() on Android, which is defined in unistd.h there. | Tobias Brunner | 2012-01-12 | 1 | -3/+4 |
| | |||||
* | Use native gettid() if available (which is the case on Android). | Tobias Brunner | 2012-01-10 | 1 | -3/+11 |
| | |||||
* | Log native thread ID when a thread is created. | Tobias Brunner | 2011-12-16 | 1 | -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 Willi | 2011-12-07 | 1 | -0/+10 |
| | | | | mangle it | ||||
* | Migrated thread_t to INIT/METHOD macros. | Tobias Brunner | 2011-10-03 | 1 | -34/+26 |
| | |||||
* | Migrated mutex_t to INIT/METHOD macros. | Tobias Brunner | 2011-10-03 | 1 | -72/+56 |
| | |||||
* | Migrated rwlock_t to INIT/METHOD macros. | Tobias Brunner | 2011-10-03 | 1 | -61/+45 |
| | |||||
* | Migrated thread_value_t to INIT/METHOD macros. | Tobias Brunner | 2011-10-03 | 1 | -17/+15 |
| | |||||
* | id of non-registered threads defaults to 0 | Andreas Steffen | 2011-05-06 | 1 | -1/+18 |
| | |||||
* | Option to skip slow addr2line resolution in leak-detective | Martin Willi | 2010-05-20 | 1 | -1/+1 |
| | |||||
* | We have to rename thread_create on Mac OS X because it conflicts with a syscall. | Tobias Brunner | 2010-04-29 | 1 | -0/+6 |
| | |||||
* | The mutex of a thread has to be locked when destroying it. | Tobias Brunner | 2010-04-29 | 1 | -0/+2 |
| | |||||
* | Adding DBG_LIB to all calls of libstrongswan's version of DBG*. | Tobias Brunner | 2010-04-06 | 3 | -11/+11 |
| |