Android Guides | Samples

Java.Lang.ThreadLocal Class

Implements a thread-local storage, that is, a variable for which each thread has its own value.

See Also: ThreadLocal

Syntax

[Android.Runtime.Register("java/lang/ThreadLocal", DoNotGenerateAcw=true)]
public class ThreadLocal : Object

Remarks

Implements a thread-local storage, that is, a variable for which each thread has its own value. All threads share the same ThreadLocal object, but each sees a different value when accessing it, and changes made by one thread do not affect the other threads. The implementation supports null values.

See Also

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Lang.ThreadLocal are listed below.

See Also: Object

Public Constructors

Creates a new thread-local variable.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Get() : Object
Returns the value of this variable for the current thread.
Remove()
Removes the entry for this variable in the current thread.
Set(Object)

Protected Methods

InitialValue() : Object
Provides the initial value of this variable for the current thread.