mailing list of musl libc
 help / color / mirror / code / Atom feed
6b65a59dd421504006c38f8232a4d6fef43a5f95 blob 455 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 
#include "pthread_impl.h"
#include <threads.h>

int mtx_unlock(mtx_t *m)
{
	if ((m->_m_type&3) == PTHREAD_MUTEX_RECURSIVE && m->_m_count) {
		if ((m->_m_lock&0x1fffffff) != __pthread_self()->tid)
			return thrd_error;
                /* _m_count is the count of additional locks, no need to real unlock */
		--m->_m_count;
	} else {
		if (a_swap(&m->_m_lock, 0)<0 || m->_m_waiters)
			__wake(&m->_m_lock, 1, 0);
	}
	return thrd_success;
}
debug log:

solving 30aa7f3 ...
found 30aa7f3 in https://inbox.vuxu.org/musl/1407144603.8274.248.camel@eris.loria.fr/

applying [1/1] https://inbox.vuxu.org/musl/1407144603.8274.248.camel@eris.loria.fr/
diff --git a/src/thread/mtx_unlock.c b/src/thread/mtx_unlock.c\r
new file mode 100644\r
index 0000000..30aa7f3\r

1:7: trailing whitespace.
#include "pthread_impl.h"\r
1:8: trailing whitespace.
#include <threads.h>\r
1:9: trailing whitespace.
\r
1:10: trailing whitespace.
int mtx_unlock(mtx_t *m)\r
1:11: trailing whitespace.
{\r
Checking patch src/thread/mtx_unlock.c...
Applied patch src/thread/mtx_unlock.c cleanly.
warning: squelched 11 whitespace errors
warning: 16 lines add whitespace errors.

index at:
100644 6b65a59dd421504006c38f8232a4d6fef43a5f95	src/thread/mtx_unlock.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).