Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Apr 2005 11:24:34 GMT
From:      David Xu <davidxu@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 74659 for review
Message-ID:  <200504071124.j37BOYUg037002@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=74659

Change 74659 by davidxu@davidxu_alona on 2005/04/07 11:23:45

	1. TD_CREATE event should only be masked by global event mask.
	2. Allow _thr_report_event to accept data pointer.

Affected files ...

.. //depot/projects/davidxu_thread/src/lib/libthr/thread/thr_event.c#4 edit
.. //depot/projects/davidxu_thread/src/lib/libthr/thread/thr_private.h#10 edit

Differences ...

==== //depot/projects/davidxu_thread/src/lib/libthr/thread/thr_event.c#4 (text+ko) ====

@@ -47,25 +47,25 @@
 
 void _thr_report_create(struct pthread *curthread)
 {
-	_thr_report_event(curthread, TD_CREATE);
+	_thr_report_event(curthread, TD_CREATE, 0);
 }
 
 void _thr_report_death(struct pthread *curthread)
 {
-	_thr_report_event(curthread, TD_DEATH);
+	_thr_report_event(curthread, TD_DEATH, 0);
 }
 
 void
-_thr_report_event(struct pthread *curthread, int event)
+_thr_report_event(struct pthread *curthread, int event, void *data)
 {
 	if (!_libthr_debug ||
-	    !(curthread->enable_event) ||
+	    (curthread->enable_event == 0 && event != TD_CREATE) ||
 	    !(_thread_event_mask & event))
 		return;
 	THR_UMTX_LOCK(curthread, &_thr_event_lock);
 	_thread_event.event = event;
 	_thread_event.thread = curthread;
-	_thread_event.data = 0;
+	_thread_event.data = data;
 	switch (event) {
 	case TD_CREATE:
 		_thread_create_bp();

==== //depot/projects/davidxu_thread/src/lib/libthr/thread/thr_private.h#10 (text+ko) ====

@@ -740,7 +740,7 @@
 void	_thr_assert_lock_level() __dead2;
 void	_thr_report_create(struct pthread *curthread);
 void	_thr_report_death(struct pthread *curthread);
-void	_thr_report_event(struct pthread *curthread, int event);
+void	_thr_report_event(struct pthread *curthread, int event, void *data);
 int	_thread_create_bp(void);
 int	_thread_death_bp(void);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504071124.j37BOYUg037002>