home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / task / destroyport.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-12  |  777 b   |  36 lines

  1.  
  2. #include "tek/exec.h"
  3. #include "tek/kn/exec.h"
  4.  
  5. /* 
  6. **    TEKlib
  7. **    (C) 2001 TEK neoscientists
  8. **    all rights reserved.
  9. **
  10. **    TINT TDestroyPort(TAPTR msgport)
  11. **
  12. **    destroy message port. this is a private function, there
  13. **    should be no need for the user to call it directly.
  14. */
  15.  
  16. TINT TDestroyPort(TAPTR port)
  17. {
  18.     TPORT *msgport = (TPORT *) port;
  19.     if (msgport->proxy)
  20.     {
  21.         /*
  22.         **    destroy a port proxy which was created in the replyport proxy scenario.
  23.         **    port proxies created in the msgport proxy scenario are destroyed with
  24.         **    a different destructor - see TFindSockPort()
  25.         */
  26.  
  27.         TSignal(msgport->proxy, TTASK_SIG_ABORT);
  28.         TDestroy(msgport->proxy);
  29.     }
  30.  
  31.     TFreeSignal(msgport->sigtask, msgport->signal);
  32.     kn_destroylock(&msgport->lock);
  33.     TMMUFreeHandle(msgport);
  34.     return 0;
  35. }
  36.