aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkTLS.h
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-08 21:45:03 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-08 21:45:03 +0000
commit331e2dc8eb69b093bf012d8dcd1ab652d67fc36b (patch)
treef48b803413351f38138f18f601da8cf5bab58060 /src/core/SkTLS.h
parentf51018d8f954cc644cc875dc1faab386fd6e85e3 (diff)
add flag/hint to PlatformGetSpecific. If true, then the caller requires that
the tls slot be allocated even if this is the first, to ensure that it can later call PlatformSetSpecific. When this is false (which is most of the time) the implementation may optimize by not even creating the slot, and just returning null. git-svn-id: http://skia.googlecode.com/svn/trunk@3871 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkTLS.h')
-rw-r--r--src/core/SkTLS.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/core/SkTLS.h b/src/core/SkTLS.h
index 0ce39247aa..5d0e1a649d 100644
--- a/src/core/SkTLS.h
+++ b/src/core/SkTLS.h
@@ -50,12 +50,24 @@ private:
// ourselves in a list, with the platform specific value as our head.
/**
- * implemented by the platform, to return the value of our (one) slot per-thread
+ * Implemented by the platform, to return the value of our (one) slot per-thread
+ *
+ * If forceCreateTheSlot is true, then we must have created the "slot" for
+ * our TLS, even though we know that the return value will be NULL in that
+ * case (i.e. no-slot and first-time-slot both return NULL). This ensures
+ * that after calling GetSpecific, we know that we can legally call
+ * SetSpecific.
+ *
+ * If forceCreateTheSlot is false, then the impl can either create the
+ * slot or not.
*/
- static void* PlatformGetSpecific();
+ static void* PlatformGetSpecific(bool forceCreateTheSlot);
/**
- * implemented by the platform, to set the value for our (one) slot per-thread
+ * Implemented by the platform, to set the value for our (one) slot per-thread
+ *
+ * The implementation can rely on GetSpecific(true) having been previously
+ * called before SetSpecific is called.
*/
static void PlatformSetSpecific(void*);