Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vcos_tls.h 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. Copyright (c) 2012, Broadcom Europe Ltd
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. * Neither the name of the copyright holder nor the
  12. names of its contributors may be used to endorse or promote products
  13. derived from this software without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
  18. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  21. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. /*=============================================================================
  26. VideoCore OS Abstraction Layer - thread local storage
  27. =============================================================================*/
  28. #ifndef VCOS_TLS_H
  29. #define VCOS_TLS_H
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #include "vcos_types.h"
  34. #include "pthreads/vcos_platform.h"
  35. /** Create a new thread local storage data key visible to all threads in
  36. * the current process.
  37. *
  38. * @param key The key to create
  39. */
  40. VCOS_INLINE_DECL
  41. VCOS_STATUS_T vcos_tls_create(VCOS_TLS_KEY_T *key);
  42. /** Delete an existing TLS data key.
  43. */
  44. VCOS_INLINE_DECL
  45. void vcos_tls_delete(VCOS_TLS_KEY_T tls);
  46. /** Set the value seen by the current thread.
  47. *
  48. * @param key The key to update
  49. * @param v The value to set for the current thread.
  50. *
  51. * @return VCOS_SUCCESS, or VCOS_ENOMEM if memory for this slot
  52. * could not be allocated.
  53. *
  54. * If TLS is being emulated via VCOS then the memory required
  55. * can be preallocated at thread creation time
  56. */
  57. VCOS_INLINE_DECL
  58. VCOS_STATUS_T vcos_tls_set(VCOS_TLS_KEY_T tls, void *v);
  59. /** Get the value for the current thread.
  60. *
  61. * @param key The key to update
  62. *
  63. * @return The current value for this thread.
  64. */
  65. VCOS_INLINE_DECL
  66. void *vcos_tls_get(VCOS_TLS_KEY_T tls);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif