/* sys/endthrea.c (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes */

#if defined (__MT__)

#include <sys/emx.h>
#define INCL_DOS
#include <os2emx.h>
#include "syscalls.h"

int __endthread (int tid)
{
  if (tid < MAX_THREADS && _sys_thread_table[tid] != NULL)
    {
      DosSubFreeMem (_sys_private_heap, _sys_thread_table[tid],
                     sizeof (thread_data));
      _sys_thread_table[tid] = NULL;
    }
  return (0);
}

#endif
