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
diff --git a/src/core/SkTLS.h b/src/core/SkTLS.h
index 0ce3924..5d0e1a6 100644
--- a/src/core/SkTLS.h
+++ b/src/core/SkTLS.h
@@ -50,12 +50,24 @@
// 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*);