api change to ecore_thread_pool_data_add, now has 4th argument "direct" to avoid...
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 23 Jul 2010 03:39:52 +0000 (03:39 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 23 Jul 2010 03:39:52 +0000 (03:39 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@50442 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore/Ecore.h
src/lib/ecore/ecore_thread.c

index 98de188..3c7192a 100644 (file)
@@ -348,7 +348,7 @@ extern "C" {
            const void *data,
            Eina_Bool try_no_queue);
    EAPI Eina_Bool     ecore_thread_pool_data_add(Ecore_Thread *thread, const char *key,
-           const void *value);
+           const void *value, Eina_Bool direct);
    EAPI void         *ecore_thread_pool_data_find(Ecore_Thread *thread, const char *key);
    EAPI Eina_Bool     ecore_thread_pool_data_del(Ecore_Thread *thread, const char *key);
    EAPI Eina_Bool     ecore_thread_cancel(Ecore_Thread *thread);
index b5a7ef0..6f15dbf 100644 (file)
@@ -819,6 +819,7 @@ ecore_thread_available_get(void)
  * @param thread The thread context to add to
  * @param key The name string to add the data with
  * @param value The data to add
+ * @param direct If true, this will not copy the key string (like eina_hash_direct_add)
  * @return EINA_TRUE on success, EINA_FALSE on failure
  * This adds data to the thread context, allowing for subsequent users of the thread's pool
  * to retrieve and use it without complicated mutexing.  This function can only be called by a
@@ -827,7 +828,7 @@ ecore_thread_available_get(void)
  * functions to avoid leaks.
  */
 EAPI Eina_Bool
-ecore_thread_pool_data_add(Ecore_Thread *thread, const char *key, const void *value)
+ecore_thread_pool_data_add(Ecore_Thread *thread, const char *key, const void *value, Eina_Bool direct)
 {
    Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *) thread;
    if ((!thread) || (!key) || (!value))
@@ -840,13 +841,15 @@ ecore_thread_pool_data_add(Ecore_Thread *thread, const char *key, const void *va
 
    if (!worker->u.long_run.hash)
      return EINA_FALSE;
-
+   if (direct)
+     return eina_hash_direct_add(worker->u.long_run.hash, key, value);
    return eina_hash_add(worker->u.long_run.hash, key, value);
 #else
    return EINA_TRUE;
 #endif
 }
 
+
 /**
  * @brief Find data in the pool's data
  * @param thread The thread context