Rename MT functions, add tests, fix bugs
Renamed multithreaded related functions, added simple unit tests and fix bugs caught by said tests :)
This commit is contained in:
@@ -98,9 +98,9 @@ If the mutex is locked by another thread, the behavior is undefined.
|
||||
Returns 0 on success, otherwise an error code.
|
||||
|
||||
|
||||
=head2 BH_MutexLockTry
|
||||
=head2 BH_MutexTryLock
|
||||
|
||||
int BH_MutexLockTry(BH_Mutex *mutex);
|
||||
int BH_MutexTryLock(BH_Mutex *mutex);
|
||||
|
||||
Attempts to lock the mutex.
|
||||
|
||||
@@ -144,9 +144,9 @@ the semaphore value becomes greater than 0.
|
||||
Returns 0 on success, otherwise an error code.
|
||||
|
||||
|
||||
=head2 BH_SemaphoreWaitTry
|
||||
=head2 BH_SemaphoreTryWait
|
||||
|
||||
int BH_SemaphoreWaitTry(BH_Semaphore *semaphore);
|
||||
int BH_SemaphoreTryWait(BH_Semaphore *semaphore);
|
||||
|
||||
Attempts to decrease the semaphore value by 1.
|
||||
|
||||
@@ -244,9 +244,9 @@ Returns 0 on success, otherwise an error code.
|
||||
Locks the spinlock.
|
||||
|
||||
|
||||
=head2 BH_SpinlockLockTry
|
||||
=head2 BH_SpinlockTryLock
|
||||
|
||||
int BH_SpinlockLockTry(int *lock);
|
||||
int BH_SpinlockTryLock(int *lock);
|
||||
|
||||
Attempts to lock the spinlock.
|
||||
|
||||
|
||||
@@ -97,9 +97,9 @@ I<callback> и данными I<data>.
|
||||
В случае успеха возвращает 0, иначе код ошибки.
|
||||
|
||||
|
||||
=head2 BH_MutexLockTry
|
||||
=head2 BH_MutexTryLock
|
||||
|
||||
int BH_MutexLockTry(BH_Mutex *mutex);
|
||||
int BH_MutexTryLock(BH_Mutex *mutex);
|
||||
|
||||
Производит попытку захвата мьютекса.
|
||||
|
||||
@@ -143,9 +143,9 @@ I<callback> и данными I<data>.
|
||||
В случае успеха возвращает 0, иначе код ошибки.
|
||||
|
||||
|
||||
=head2 BH_SemaphoreWaitTry
|
||||
=head2 BH_SemaphoreTryWait
|
||||
|
||||
int BH_SemaphoreWaitTry(BH_Semaphore *semaphore);
|
||||
int BH_SemaphoreTryWait(BH_Semaphore *semaphore);
|
||||
|
||||
Пытается уменьшить значение семафора на 1.
|
||||
|
||||
@@ -244,9 +244,9 @@ I<timeout>.
|
||||
Блокирует спинлок.
|
||||
|
||||
|
||||
=head2 BH_SpinlockLockTry
|
||||
=head2 BH_SpinlockTryLock
|
||||
|
||||
int BH_SpinlockLockTry(int *lock);
|
||||
int BH_SpinlockTryLock(int *lock);
|
||||
|
||||
Пытается заблокировать спинлок.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user