This source file includes following definitions.
- DestroyRandomInfoThreadSet
- AcquireRandomInfoThreadSet
#ifndef _MAGICKCORE_RANDOM_PRIVATE_H
#define _MAGICKCORE_RANDOM_PRIVATE_H
#include "magick/thread-private.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
static inline RandomInfo **DestroyRandomInfoThreadSet(
RandomInfo **random_info)
{
register ssize_t
i;
assert(random_info != (RandomInfo **) NULL);
for (i=0; i < (ssize_t) GetMagickResourceLimit(ThreadResource); i++)
if (random_info[i] != (RandomInfo *) NULL)
random_info[i]=DestroyRandomInfo(random_info[i]);
return((RandomInfo **) RelinquishAlignedMemory(random_info));
}
static inline RandomInfo **AcquireRandomInfoThreadSet(void)
{
register ssize_t
i;
RandomInfo
**random_info;
size_t
number_threads;
number_threads=(size_t) GetMagickResourceLimit(ThreadResource);
random_info=(RandomInfo **) AcquireAlignedMemory(number_threads,
sizeof(*random_info));
if (random_info == (RandomInfo **) NULL)
return((RandomInfo **) NULL);
(void) ResetMagickMemory(random_info,0,number_threads*sizeof(*random_info));
for (i=0; i < (ssize_t) number_threads; i++)
{
random_info[i]=AcquireRandomInfo();
if (random_info[i] == (RandomInfo *) NULL)
return(DestroyRandomInfoThreadSet(random_info));
}
return(random_info);
}
extern MagickExport unsigned long
*GetRandomInfoSeed(RandomInfo *);
extern MagickExport double
GetRandomInfoNormalize(const RandomInfo *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif