00001 /* * 00002 * This file is part of libnemesi 00003 * 00004 * Copyright (C) 2007 by LScube team <team@streaming.polito.it> 00005 * See AUTHORS for more details 00006 * 00007 * libnemesi is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * libnemesi is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with libnemesi; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 * 00021 * */ 00022 00023 #include <string.h> 00024 00025 #include "version.h" 00026 #include "comm.h" 00027 00028 #include <pthread.h> 00029 00030 inline void nms_header(void) 00031 { 00032 nms_printf(NMSML_ALWAYS, 00033 "\n" NMSCLR_BLUE_BOLD "%s - %s -- release %s (%s)\n\n" 00034 NMSCLR_DEFAULT, PROG_NAME, PROG_DESCR, VERSION, VERSION_NAME); 00035 } 00036 00037 int thread_isvalid(pthread_t p) 00038 { 00039 #ifdef WIN32 00040 return p.p; 00041 #else 00042 return p; 00043 #endif 00044 } 00045 00046 void thread_invalidate(pthread_t * p) 00047 { 00048 #ifdef WIN32 00049 p->p = 0; 00050 #else 00051 *p = 0; 00052 #endif 00053 } 00054 00055 int thread_getuid(pthread_t p) 00056 { 00057 return thread_isvalid(p); 00058 }
1.5.4