Date: Tue, 4 Jan 2005 23:56:36 GMT From: David Xu <davidxu@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 68281 for review Message-ID: <200501042356.j04NuaEI057015@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=68281 Change 68281 by davidxu@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"); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501042356.j04NuaEI057015>