Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10257

Quick Thread Local Storage set-up has a small flaw

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • 2.6.4
    • None
    • libhdfs
    • None
    • Linux

    Description

      In jni_helper.c in the getJNIEnv function

      The “THREAD_LOCAL_STORAGE_SET_QUICK(env);” Macro is in the wrong location;

      It should precede the “threadLocalStorageSet(env)” as follows ::

      THREAD_LOCAL_STORAGE_SET_QUICK(env);

      if (threadLocalStorageSet(env))

      { return NULL; }

      AND IN “thread_local_storage.h” the macro: “THREAD_LOCAL_STORAGE_SET_QUICK”
      should be as follows ::

      #ifdef HAVE_BETTER_TLS
      #define THREAD_LOCAL_STORAGE_GET_QUICK() \
      static __thread JNIEnv *quickTlsEnv = NULL; \
      { \
      if (quickTlsEnv)

      { \ return quickTlsEnv; \ }

      \
      }

      #define THREAD_LOCAL_STORAGE_SET_QUICK(env) \

      { \ quickTlsEnv = (env); \ return env; }

      #else
      #define THREAD_LOCAL_STORAGE_GET_QUICK()
      #define THREAD_LOCAL_STORAGE_SET_QUICK(env)
      #endif

      Attachments

        Activity

          People

            Unassigned Unassigned
            stevebovy Stephen Bovy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 72h
                72h
                Remaining:
                Remaining Estimate - 72h
                72h
                Logged:
                Time Spent - Not Specified
                Not Specified