<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc_r/uthread/uthread_fd.c, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2010-11-13T22:22:18Z</updated>
<entry>
<title>Remove libc_r threading library.  It has been disconnected from the build</title>
<updated>2010-11-13T22:22:18Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2010-11-13T22:22:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=13ec45d6449d744a84d862496feadda5caabddb9'/>
<id>urn:sha1:13ec45d6449d744a84d862496feadda5caabddb9</id>
<content type='text'>
for four years (since r162846).

Submitted by: Alexander Best arundel@
</content>
</entry>
<entry>
<title>Remove 3rd clause, renumber, ok per email</title>
<updated>2007-01-12T07:26:21Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2007-01-12T07:26:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fed32d75449d7d05afdd7ddb7703bfa69a3027f3'/>
<id>urn:sha1:fed32d75449d7d05afdd7ddb7703bfa69a3027f3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove much of the dereferencing of the fd table entries to look</title>
<updated>2002-08-29T23:06:07Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2002-08-29T23:06:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d8b5986dd6a718d948b9ea0e2da3256ac45bff42'/>
<id>urn:sha1:d8b5986dd6a718d948b9ea0e2da3256ac45bff42</id>
<content type='text'>
at file flags and replace it with functions that will avoid null
pointer checks.

MFC to be done by archie ;-)

PR:		42100
Reviewed by:	archie, robert
MFC after:	3 days
</content>
</entry>
<entry>
<title>In the words of the submitter:</title>
<updated>2001-10-21T18:23:50Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2001-10-21T18:23:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f39105fa50a8ff106edc2b9f93cf6371899f9517'/>
<id>urn:sha1:f39105fa50a8ff106edc2b9f93cf6371899f9517</id>
<content type='text'>
  In libc_r, if _FDLOCKS_ENABLED is not defined, there is no guarantee
  in many of the sycall wrappers that _thread_fd_table[fd] is
  initialized.  This causes problems for programs that pass in file
  descriptors and execve() another program; when the exec'ed program
  tries to do an fcntl() or other syscall on the passed-in fd, it fails.

Add calls to initialize the FD table entry for _thread_fd_lock and
_thread_fd_lock_debug.

Submitted by:	Peter S. Housel &lt;housel@acm.org&gt;
</content>
</entry>
<entry>
<title>Remove (int) file descriptor locking.  It should be up to the</title>
<updated>2001-02-11T22:07:32Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2001-02-11T22:07:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f434cd45ed4d4243594eaf3bc680911991071521'/>
<id>urn:sha1:f434cd45ed4d4243594eaf3bc680911991071521</id>
<content type='text'>
application to provide locking for I/O operations.  This doesn't
break any of my tests, but the old behavior can be restored by
compiling with _FDLOCKS_ENABLED.  This will eventually be removed
when it is obvious it does not cause any problems.

Remove most of flockfile implementation, with the exception of
flockfile_debug.

Make error messages more informational (submitted by Mike Heffner
&lt;spock@techfour.net&gt;, who's now known as mikeh@FreeBSD.org).
</content>
</entry>
<entry>
<title>_exit in libc is now __sys_exit not __sys__exit.</title>
<updated>2001-01-29T03:24:23Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2001-01-29T03:24:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=221b1e69c51f32e44f7f072b3416b7c8c3ad113e'/>
<id>urn:sha1:221b1e69c51f32e44f7f072b3416b7c8c3ad113e</id>
<content type='text'>
Add another check for thread library initialization (jdp, we
really need a way to get _thread_init called at program start
before any constructors are run).
</content>
</entry>
<entry>
<title>Add weak definitions for wrapped system calls.  In general:</title>
<updated>2001-01-24T13:03:38Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2001-01-24T13:03:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e5106342c6de9cbe26c4827e4e29bae309cd8cfb'/>
<id>urn:sha1:e5106342c6de9cbe26c4827e4e29bae309cd8cfb</id>
<content type='text'>
	_foo - wrapped system call
	foo - weak definition to _foo

and for cancellation points:

	_foo - wrapped system call
	__foo - enter cancellation point, call _foo(), leave
	        cancellation point
	foo - weak definition to __foo

Change use of global _thread_run to call a function to get the
currently running thread.

Make all pthread_foo functions weak definitions to _pthread_foo,
where _pthread_foo is the implementation.  This allows an application
to provide its own pthread functions.

Provide slightly different versions of pthread_mutex_lock and
pthread_mutex_init so that we can tell the difference between
a libc mutex and an application mutex.  Threads holding mutexes
internal to libc should never be allowed to exit, call signal
handlers, or cancel.

Approved by:	-arch
</content>
</entry>
<entry>
<title>Implement zero system call thread switching.  Performance of</title>
<updated>2000-10-13T22:12:32Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2000-10-13T22:12:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fbeb36e4bf72161883eda56a41578de1d8f2f885'/>
<id>urn:sha1:fbeb36e4bf72161883eda56a41578de1d8f2f885</id>
<content type='text'>
thread switches should be on par with that under scheduler
activations.

  o Timing is achieved through the use of a fixed interval
    timer (ITIMER_PROF) to count scheduling ticks instead
    of retrieving the time-of-day upon every thread switch
    and calculating elapsed real time.

  o Polling for I/O readiness is performed once for each
    scheduling tick instead of every thread switch.

  o The non-signal saving/restoring versions of setjmp/longjmp
    are used to save and restore thread contexts.  This may
    allow the removal of _THREAD_SAFE macros from setjmp()
    and longjmp() - needs more investigation.

Change signal handling so that signals are handled in the
context of the thread that is receiving the signal.  When
signals are dispatched to a thread, a special signal handling
frame is created on top of the target threads stack.  The
frame contains the threads saved state information and a new
context in which the thread can run.  The applications signal
handler is invoked through a wrapper routine that knows how
to restore the threads saved state and unwind to previous
frames.

Fix interruption of threads due to signals.  Some states
were being improperly interrupted while other states were
not being interrupted.  This should fix several PRs.

Signal handlers, which are invoked as a result of a process
signal (not by pthread_kill()), are now called with the
code (or siginfo_t if SA_SIGINFO was set in sa_flags) and
sigcontext_t as received from the process signal handler.

Modify the search for a thread to which a signal is delivered.
The search algorithm is now:

  o First thread found in sigwait() with signal in wait mask.
  o First thread found sigsuspend()'d on the signal.
  o Current thread if signal is unmasked.
  o First thread found with signal unmasked.

Collapse machine dependent support into macros defined in
pthread_private.h.  These should probably eventually be moved
into separate MD files.

Change the range of settable priorities to be compliant with
POSIX (0-31).  The threads library uses higher priorities
internally for real-time threads (not yet implemented) and
threads executing signal handlers.  Real-time threads and
threads running signal handlers add 64 and 32, respectively,
to a threads base priority.

Some other small changes and cleanups.

PR:		17757 18559 21943
Reviewed by:	jasone
</content>
</entry>
<entry>
<title>Implement continuations to correctly handle [sig|_]longjmp() inside of a</title>
<updated>2000-01-19T07:04:50Z</updated>
<author>
<name>Jason Evans</name>
<email>jasone@FreeBSD.org</email>
</author>
<published>2000-01-19T07:04:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0a3fa43c7e06dfbd6ddde4767d9c8a0c6a2ad51f'/>
<id>urn:sha1:0a3fa43c7e06dfbd6ddde4767d9c8a0c6a2ad51f</id>
<content type='text'>
signal handler.  Explicitly check for jumps to anywhere other than the
current stack, since such jumps are undefined according to POSIX.

While we're at it, convert thread cancellation to use continuations, since
it's cleaner than the original cancellation code.

Avoid delivering a signal to a thread twice.  This was a pre-existing bug,
but was likely unexposed until these other changes were made.

Defer signals generated by pthread_kill() so that they can be delivered on
the appropriate stack.  deischen claims that this is unnecessary, which is
likely true, but without this change, pthread_kill() can cause undefined
priority queue states and/or PANICs in [sig|_]longjmp(), so I'm leaving
this in for now.  To compile this code out and exercise the bug, define
the _NO_UNDISPATCH cpp macro.  Defining _PTHREADS_INVARIANTS as well will
cause earlier crashes.

PR:			kern/14685
Collaboration with:	deischen
</content>
</entry>
<entry>
<title>Fix problems with cancellation while in critical regions.</title>
<updated>1999-12-17T00:57:54Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>1999-12-17T00:57:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fc8f3f5bfe691a89cc23a521c08e0128fbf8c2ae'/>
<id>urn:sha1:fc8f3f5bfe691a89cc23a521c08e0128fbf8c2ae</id>
<content type='text'>
  o Cancellation flags were not getting properly set/cleared.
  o Loops waiting for internal locks were not being exited
    correctly by a cancelled thread.
  o Minor spelling (cancelation -&gt; cancellation) and formatting
    corrections (missing tab).

Found by:	tg
Reviewed by:	jasone
</content>
</entry>
</feed>
