mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-31 11:18:42 +02:00
standards‑compliant thread id string
This commit is contained in:
@@ -85,6 +85,30 @@ static inline MagickThreadType GetMagickThreadId(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void DecorateFilenameWithThreadId(const char *filename,
|
||||
char *thread_filename)
|
||||
{
|
||||
MagickThreadType
|
||||
id;
|
||||
|
||||
char
|
||||
thread_id[2*sizeof(id)+1];
|
||||
|
||||
ssize_t
|
||||
i;
|
||||
|
||||
unsigned char
|
||||
bytes[sizeof(id)];
|
||||
|
||||
id=GetMagickThreadId();
|
||||
(void) memcpy(bytes,&id,sizeof(id));
|
||||
for (i=0; i < (ssize_t) sizeof(bytes); i++)
|
||||
(void) sprintf(thread_id+2*i,"%02x",bytes[i]);
|
||||
thread_id[sizeof(thread_id)-1]='\0';
|
||||
(void) FormatLocaleString(thread_filename,MagickPathExtent,"%s|%s",thread_id,
|
||||
filename);
|
||||
}
|
||||
|
||||
static inline size_t GetMagickThreadSignature(void)
|
||||
{
|
||||
#if defined(MAGICKCORE_THREAD_SUPPORT)
|
||||
|
||||
@@ -36,13 +36,6 @@ extern ModuleExport size_t \
|
||||
extern ModuleExport void \
|
||||
Unregister ## coder ## Image(void);
|
||||
|
||||
static inline void DecorateFilenameWithThreadId(const char *filename,
|
||||
char *thread_filename)
|
||||
{
|
||||
(void) FormatLocaleString(thread_filename,MagickPathExtent,"%.20g|%s",
|
||||
(double) GetMagickThreadId(),filename);
|
||||
}
|
||||
|
||||
static inline ImageType IdentifyImageCoderType(const Image *image,
|
||||
ExceptionInfo *exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user