/[hurd]/hurd/libpthread/sysdeps/mach/pt-thread-halt.c
ViewVC logotype

Diff of /hurd/libpthread/sysdeps/mach/pt-thread-halt.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by neal, Thu Oct 10 23:05:05 2002 UTC revision 1.2 by neal, Wed May 4 16:04:06 2005 UTC
# Line 1  Line 1 
1  /* Deallocate the kernel thread resources.  Mach version.  /* Deallocate the kernel thread resources.  Mach version.
2     Copyright (C) 2000,02 Free Software Foundation, Inc.     Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
3     This file is part of the GNU C Library.     This file is part of the GNU C Library.
4    
5     The GNU C Library is free software; you can redistribute it and/or     The GNU C Library is free software; you can redistribute it and/or
# Line 23  Line 23 
23    
24  #include <pt-internal.h>  #include <pt-internal.h>
25    
26    /* Stop the kernel thread associated with THREAD.  If NEED_DEALLOC is
27       true, the function must call __pthread_dealloc on THREAD.
28    
29  /* Deallocate the kernel thread resources associated with THREAD.  */     NB: The thread executing this function may be the thread which is
30       being halted, thus the last action should be halting the thread
31       itself.  */
32  void  void
33  __pthread_thread_halt (struct __pthread *thread)  __pthread_thread_halt (struct __pthread *thread, int need_dealloc)
34  {  {
35    error_t err;    error_t err;
36      thread_t tid = thread->kernel_thread;
37    
38    err = __mach_port_deallocate (__mach_task_self (),    if (need_dealloc)
39                                  thread->wakeupmsg.msgh_remote_port);      __pthread_dealloc (thread);
   assert_perror (err);  
40    
41    err = __thread_terminate (thread->kernel_thread);    err = __thread_terminate (tid);
42    assert_perror (err);    assert_perror (err);
43  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26