From 40d92d5ba219aba2da5ef01a927cf0e2a563608b Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 19 Nov 2008 00:14:44 -0800 Subject: [PATCH] Document that libexif is now thread safe (when used appropriately). Also, clarify the string encoding issue since gettext takes care of converting strings into the appropriate locale's encoding. --- ChangeLog | 2 +- NEWS | 3 +++ libexif/exif.h | 21 ++++++++++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea33a2c..b350800 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2008-11-18 Dan Fandrich * libexif/exif-entry.c & configure.ac: use localtime_r when available - to be more thread safe + to make libexif thread safe * po/nl.po: Updated Dutch translation by Erwin Poeze * po/pl.po: Updated Polish translation by Jakub Bogusz * contrib/examples/*: Added a couple of simple example programs diff --git a/NEWS b/NEWS index 494df1c..048f472 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ libexif-0.6.x: * Updated translations: nl, pl * Added some example programs + * libexif is now thread safe when the underlying C library is thread safe + and when each object allocated by libexif isn't used by more than one + thread simultaneously libexif-0.6.17 (2008-11-06): * Updated translations: cs, de, pl, sk, vi diff --git a/libexif/exif.h b/libexif/exif.h index da29bce..9f490ae 100644 --- a/libexif/exif.h +++ b/libexif/exif.h @@ -1,7 +1,7 @@ /*! \file exif.h exif/exif.h - * \brief Dummy header file + * \brief Dummy header file for documentation purposes * \date 2007 - * \author Hans Ulrich Niedermann + * \author Hans Ulrich Niedermann, et. al. * * \mainpage The libexif library * @@ -19,8 +19,10 @@ * * \section string_conventions String Conventions * - * Strings of 8 bit characters ("char*"). Character set and encoding - * are currently undefined, but that will change in the future. + * Strings of 8 bit characters ("char*"). When libexif is compiled with + * NLS, character set and encoding are as set in the current locale, + * except for strings that come directly from the data in EXIF + * tags which are returned in raw form. * * \section memory_management Memory Management Patterns * @@ -35,6 +37,15 @@ * * \section thread_safety Thread Safety * - * FIXME: Good question. Needs to be determined. + * libexif is thread safe when the underlying C library is also thread safe. + * Some libraries may require defining a special macro (like _REENTRANT) + * to ensure this, or may require linking to a special thread-safe version of + * the library. + * + * The programmer must ensure that each object allocated by libexif is only + * used in a single thread at once. For example, an ExifData* allocated + * in one thread can't be used in a second thread if there is any chance + * that the first thread could use it at the same time. Two threads + * can use libexif without issues if they never share handles. * */ -- 2.7.4