author | chegar |
Wed, 16 Dec 2015 12:17:03 +0000 | |
changeset 34705 | 228508cfabc4 |
parent 32181 | dee472a9b4db |
permissions | -rw-r--r-- |
1 | 1 |
/* |
32181
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
2 |
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
14583
d70ee55535f4
8003935: Simplify the needed includes for using Thread::current()
stefank
parents:
7397
diff
changeset
|
26 |
#include "runtime/thread.inline.hpp" |
7397 | 27 |
#include "runtime/threadLocalStorage.hpp" |
28 |
||
32181
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
29 |
// True thread-local variable |
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
30 |
__thread Thread * ThreadLocalStorage::_thr_current = NULL; |
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
31 |
|
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
32 |
// Implementations needed to support the shared API |
1 | 33 |
|
32181
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
34 |
void ThreadLocalStorage::pd_invalidate_all() {} // nothing to do |
1 | 35 |
|
32181
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
36 |
bool ThreadLocalStorage::_initialized = false; |
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
37 |
|
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
38 |
void ThreadLocalStorage::init() { |
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
39 |
_initialized = true; |
1 | 40 |
} |
41 |
||
32181
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
42 |
bool ThreadLocalStorage::is_initialized() { |
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
43 |
return _initialized; |
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
44 |
} |
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
45 |
|
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
46 |
Thread* ThreadLocalStorage::get_thread_slow() { |
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
47 |
return thread(); |
dee472a9b4db
8130212: Thread::current() might access freed memory on Solaris
dholmes
parents:
14583
diff
changeset
|
48 |
} |
1 | 49 |
|
50 |
extern "C" Thread* get_thread() { |
|
51 |
return ThreadLocalStorage::thread(); |
|
52 |
} |