~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to lib/misc/vthreadBase.c

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-06-20 15:59:51 UTC
  • mfrom: (1.4.8)
  • Revision ID: package-import@ubuntu.com-20120620155951-6rupmpb0f70b52zr
Tags: 2012.05.21-724730-0ubuntu1
* Merging upstream version 2012.05.21-724730.
  - Fixes building against the current Quantal kernel. (LP: #1000344)
  - Fixes Quantal installation issues. (LP: #1019031)

* Sync with Debian
  - Updating to debhelper version 9.
  - Updating to standards version 3.9.3.
  - Updating copyright file machine-readable format version 1.0.
  - Building without multiarch paths for now

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
#include "str.h"
101
101
#include "util.h"
102
102
#include "hashTable.h"
 
103
#include "hostinfo.h"
103
104
 
104
105
 
105
106
/*
119
120
#define VTHREADBASE_INVALID_KEY (VThreadBaseKeyType)(TLS_OUT_OF_INDEXES)
120
121
#else
121
122
typedef pthread_key_t VThreadBaseKeyType;
 
123
/* PTHREAD_KEYS_MAX not defined on Android. */
 
124
#if defined __linux__ && !defined PTHREAD_KEYS_MAX
 
125
#define VTHREADBASE_INVALID_KEY (VThreadBaseKeyType)(1024)
 
126
#else
122
127
#define VTHREADBASE_INVALID_KEY (VThreadBaseKeyType)(PTHREAD_KEYS_MAX)
123
128
#endif
 
129
#endif
124
130
 
125
131
static void VThreadBaseSimpleNoID(void);
126
132
static void VThreadBaseSimpleFreeID(void *tlsData);
205
211
 */
206
212
 
207
213
#if defined __GNUC__
208
 
/* gcc-4.1.0 and gcc-4.1.1 have buggy weak-symbol optimiziation. */
 
214
/* gcc-4.1.0 and gcc-4.1.1 have buggy weak-symbol optimization. */
209
215
#  if __GNUC__ == 4 && __GNUC_MINOR__ == 1 && \
210
216
     (__GNUC_PATCHLEVEL__ == 0 || __GNUC_PATCHLEVEL__ == 1)
211
217
#  error Cannot build VThreadBase with weak symbols: buggy gcc version
923
929
static Bool
924
930
VThreadBaseNativeIsAlive(void *native)
925
931
{
926
 
   HANDLE hThread = OpenThread(THREAD_QUERY_INFORMATION, FALSE,
 
932
   // Different access level due to impersonation see PR#780775
 
933
   HANDLE hThread = OpenThread(Hostinfo_OpenThreadBits(), FALSE,
927
934
                               (DWORD)(uintptr_t)native);
928
935
 
929
936
   if (hThread != NULL) {
1007
1014
 
1008
1015
      newID = Atomic_FetchAndInc(&vthreadBaseGlobals.dynamicID);
1009
1016
      /*
1010
 
       * Detect VThreadID overflow (~0 is used as a sentinal).
 
1017
       * Detect VThreadID overflow (~0 is used as a sentinel).
1011
1018
       * Leave a space of ~10 IDs, since the increment and bounds-check
1012
1019
       * are not atomic.
1013
1020
       */