1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-29 04:31:45 +02:00
libunwind-eh_elf/src/dyn-register.c
mostang.com!davidm 78306c6f14 Move pthread-locking stuff to "internal.h".
(_U_dyn_info_list_lock): Rename from "registration_lock" and change from r/w-lock
	to a simple mutex (spin) lock.
(_U_dyn_register): Insert into doubly-linked list.

(Logical change 1.30)
2002-12-12 09:17:41 +00:00

20 lines
398 B
C

#include "internal.h"
pthread_mutex_t _U_dyn_info_list_lock = PTHREAD_MUTEX_INITIALIZER;
void
_U_dyn_register (unw_dyn_info_t *di)
{
mutex_lock (&_U_dyn_info_list_lock);
{
++_U_dyn_info_list.generation;
di->next = _U_dyn_info_list.first;
di->prev = NULL;
if (di->next)
di->next->prev = di;
_U_dyn_info_list.first = di;
}
mutex_unlock (&_U_dyn_info_list_lock);
}