PERFORCE change 68281 for review
David Xu
davidxu at FreeBSD.org
Tue Jan 4 15:56:38 PST 2005
http://perforce.freebsd.org/chv.cgi?CH=68281
Change 68281 by davidxu at davidxu_tiger on 2005/01/04 23:55:48
Reduce the code size depends on thr_xxx api.
now only need:
1. umtx API.
2. thr_create and thr_exit.(which can be replaced
with kse_create & kse_exit);
Affected files ...
.. //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_mutex.c#9 edit
Differences ...
==== //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_mutex.c#9 (text+ko) ====
@@ -928,6 +928,7 @@
static inline int
mutex_self_lock(struct pthread *curthread, pthread_mutex_t m)
{
+ struct timespec ts;
int ret;
switch (m->m_type) {
@@ -948,8 +949,10 @@
if (m->m_protocol != PTHREAD_PRIO_NONE) {
/* Unlock the mutex structure: */
THR_LOCK_RELEASE(curthread, &m->m_lock);
+ ts.tv_sec = 30;
+ ts.tv_nsec = 0;
for (;;)
- thr_suspend(NULL);
+ __sys_nanosleep(&ts, NULL);
} else {
PANIC("shouldn't be here!\n");
}
More information about the p4-projects
mailing list