You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in src/general.c, S3_initialize and S3_deinitialize using initializeCountG to decide whether s3 need to initialize or deinitialize, it will cause curl aborted issue when create multithread clients.
suggest:
in src/general.c, S3_initialize and S3_deinitialize using initializeCountG to decide whether s3 need to initialize or deinitialize, it will cause curl aborted issue when create multithread clients.
suggest:
`#include <ctype.h>
#include <string.h>
#include "request.h"
#include "simplexml.h"
#include "util.h"
#include "pthread.h"
static int initializeCountG = 0;
pthread_mutex_t initializeGlbMutex = PTHREAD_MUTEX_INITIALIZER;
S3Status S3_initialize(const char *userAgentInfo, int flags,
const char *defaultS3HostName)
{
pthread_mutex_lock(&initializeGlbMutex);
if (initializeCountG++) {
pthread_mutex_unlock(&initializeGlbMutex);
return S3StatusOK;
}
pthread_mutex_unlock(&initializeGlbMutex);
}
void S3_deinitialize()
{
pthread_mutex_lock(&initializeGlbMutex);
if (--initializeCountG) {
pthread_mutex_unlock(&initializeGlbMutex);
return;
}
pthread_mutex_unlock(&initializeGlbMutex);
}`
The text was updated successfully, but these errors were encountered: