tls-helper.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * tls-helper.h
  3. *
  4. * Description:
  5. *
  6. * --------------------------------------------------------------------------
  7. *
  8. * Pthreads-embedded (PTE) - POSIX Threads Library for embedded systems
  9. * Copyright(C) 2008 Jason Schmidlapp
  10. *
  11. * Contact Email: [email protected]
  12. *
  13. * This library is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU Lesser General Public
  15. * License as published by the Free Software Foundation; either
  16. * version 2 of the License, or (at your option) any later version.
  17. *
  18. * This library is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. * Lesser General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Lesser General Public
  24. * License along with this library in the file COPYING.LIB;
  25. * if not, write to the Free Software Foundation, Inc.,
  26. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  27. */
  28. #ifndef _TLS_HELPER_H_
  29. #define _TLS_HELPER_H_
  30. #include "pte_osal.h"
  31. /// @todo document..
  32. pte_osResult pteTlsGlobalInit(int maxEntries);
  33. void * pteTlsThreadInit(void);
  34. pte_osResult pteTlsAlloc(unsigned int *pKey);
  35. void * pteTlsGetValue(void *pTlsThreadStruct, unsigned int index);
  36. pte_osResult pteTlsSetValue(void *pTlsThreadStruct, unsigned int index, void * value);
  37. pte_osResult pteTlsFree(unsigned int index);
  38. void pteTlsThreadDestroy(void * pTlsThreadStruct);
  39. void pteTlsGlobalDestroy(void);
  40. #endif // _TLS_HELPER_H_