]> git.imager.perl.org - imager.git/blobdiff - lib/Imager/APIRef.pod
add mutex functions to the API
[imager.git] / lib / Imager / APIRef.pod
index 8949d460ce553f22072c74cf55537697102f6fea..1f61bb145280aee1c7f7b1d21e189b1c33b1bfb4 100644 (file)
@@ -109,6 +109,12 @@ Imager::APIRef - Imager's C API - reference.
 
   # Logging
 
+  # Mutex functions
+  i_mutex_t m = i_mutex_new();
+  i_mutex_destroy(m);
+  i_mutex_lock(m);
+  i_mutex_unlock(m);
+
   # Paletted images
 
   # Tags
@@ -1876,6 +1882,58 @@ This is an internal function called by the mm_log() macro.
 From: File log.c
 
 
+=back
+
+=head2 Mutex functions
+
+=over
+
+=item i_mutex_new()
+
+  i_mutex_t m = i_mutex_new();
+
+Create a mutex.
+
+If a critical section cannot be created for whatever reason, Imager
+will abort.
+
+
+=for comment
+From: File mutexwin.c
+
+=item i_mutex_destroy(m)
+
+  i_mutex_destroy(m);
+
+Destroy a mutex.
+
+
+=for comment
+From: File mutexwin.c
+
+=item i_mutex_lock(m)
+
+  i_mutex_lock(m);
+
+Lock the mutex, waiting if another thread has the mutex locked.
+
+
+=for comment
+From: File mutexwin.c
+
+=item i_mutex_unlock(m)
+
+  i_mutex_unlock(m);
+
+Release the mutex.
+
+The behavior of releasing a mutex you don't hold is unspecified.
+
+
+=for comment
+From: File mutexwin.c
+
+
 =back
 
 =head2 Paletted images
@@ -2210,6 +2268,31 @@ Returns ~0UL on failure.
 =for comment
 From: File io.c
 
+=item im_context_refdec(ctx, where)
+X<im_context_refdec API>
+=section Context objects
+
+  im_context_refdec(aIMCTX, "a description");
+
+Remove a reference to the context, releasing it if all references have
+been removed.
+
+
+=for comment
+From: File context.c
+
+=item im_context_refinc(ctx, where)
+X<im_context_refinc API>
+=section Context objects
+
+  im_context_refinc(aIMCTX, "a description");
+
+Add a new reference to the context.
+
+
+=for comment
+From: File context.c
+
 =item im_errors(ctx)
 
   i_errmsg *errors = im_errors(aIMCTX);
@@ -2251,14 +2334,6 @@ will change:
 
 =item *
 
-B<im_context_refdec>
-
-=item *
-
-B<im_context_refinc>
-
-=item *
-
 B<im_lhead>
 
 =item *