Deleted Added
full compact
gthr-vxworks.h (50397) gthr-vxworks.h (52284)
1/* Threads compatibily routines for libgcc2 for VxWorks. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1997 Free Software Foundation, Inc.
4 Contributed by Mike Stump <mrs@wrs.com>.
5
6This file is part of GNU CC.
7
8GNU CC is free software; you can redistribute it and/or modify

--- 46 unchanged lines hidden (view full) ---

55}
56
57extern __gthread_key_t eh_context_key;
58
59/* This is not the right way to do it, but the semantic of pthreads
60 don't map well enough onto VxWorks. */
61
62static void
1/* Threads compatibily routines for libgcc2 for VxWorks. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1997 Free Software Foundation, Inc.
4 Contributed by Mike Stump <mrs@wrs.com>.
5
6This file is part of GNU CC.
7
8GNU CC is free software; you can redistribute it and/or modify

--- 46 unchanged lines hidden (view full) ---

55}
56
57extern __gthread_key_t eh_context_key;
58
59/* This is not the right way to do it, but the semantic of pthreads
60 don't map well enough onto VxWorks. */
61
62static void
63__ehdtor ()
63__ehdtor (void *pTcb)
64{
64{
65 if (eh_context_key)
66 free ((void*)eh_context_key);
67 eh_context_key = 0;
65 int tid = (int) pTcb;
66 void *p = (void*)taskVarGet(tid, &eh_context_key);
67 if (p != (void*)-1)
68 {
69 if (p)
70 free (p);
71 taskVarSet(tid, &eh_context_key, 0);
72 }
68}
69
70/* This only works for the code in libgcc2.c. */
71
72static inline int
73__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
74{
75 *key = 0;
76
73}
74
75/* This only works for the code in libgcc2.c. */
76
77static inline int
78__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
79{
80 *key = 0;
81
82 /* Do this first so that the task variables are visible during the
83 running of the delete hook. */
84
85 taskVarInit();
86
77 /* We don't have a way to track dtor here, so instead, we
78 register a generic routine that can cleanup any task. */
79
80 taskDeleteHookAdd (__ehdtor);
81
82 return 0;
83}
84

--- 48 unchanged lines hidden ---
87 /* We don't have a way to track dtor here, so instead, we
88 register a generic routine that can cleanup any task. */
89
90 taskDeleteHookAdd (__ehdtor);
91
92 return 0;
93}
94

--- 48 unchanged lines hidden ---