[PATCH] make rwlocks SHAREABLE + cleanups

[email protected]
Newsgroups gmane.linux.ngpt.devel
Message-ID <[email protected]>
a) I made a patch to support PROCESS_SHARED rwlocks.

b) while doing this I had to supply the patch in pth_sched.c and the 
dopoll flag
	- therefore it's included:
@@ -840,7 +840,7 @@
  		    this_occurred = FALSE;

  		    /* Filedescriptor I/O */
-		    if (ev->ev_type == PTH_EVENT_FD && !dopoll && (ds == descr)) {
+		    if (ev->ev_type == PTH_EVENT_FD && (ds == descr)) {
  			/* filedescriptors are checked later all at once.
  			   Here we only assemble them in the fd sets */
  			if (ev->ev_goal & PTH_UNTIL_FD_READABLE)
@@ -1035,7 +1035,7 @@
      FD_SET(descr->sigpipe[0], &rfds);

      /* If dopoll is set, handle the thread from ready queue... */
-    if (dopoll)
+    if (dopoll && m_to_n)
  	return;


c) declaration pthread_kill_all_threads() removed from td_manager.c but 
still
	does not compile when configuring --enable-thread_db

d) fixed a memory leak in pthread_cond_init()
-	rc = pth_cond_init(cn);
+	if (!(rc = pth_cond_init(cn)))
+		pth_free(cn);

e) replaced EDEADLK with EPERM or EINVAL
	pthread_mutex_lock or pthread_rwlock_*lock should return EDEADLK
	when the same thread already holds the lock (and it's not recursive)

	the checking has to be improved on this (i.e. when pshared)
ngpt.new (application/octet-stream, 15.6 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.