Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

perl_mutex isn't available on unthreaded perls

I assumed it was defined to be a no-op there. It isn't. Cope with that.
  • Loading branch information...
commit e55394ca4e4bde476ab112c420d8e52ab3a681e3 1 parent 8fb5d9e
Florian Ragwitz rafl authored

Showing 1 changed file with 7 additions and 0 deletions. Show diff stats Hide diff stats

  1. +7 0 perl_mongo.c
7 perl_mongo.c
@@ -29,7 +29,10 @@ static void serialize_regex(buffer*, const char*, REGEXP*, int is_insert);
29 29 static void serialize_regex_flags(buffer*, SV*);
30 30 static void append_sv (buffer *buf, const char *key, SV *sv, stackette *stack, int is_insert);
31 31
  32 +#ifdef USE_ITHREADS
32 33 static perl_mutex inc_mutex;
  34 +#endif
  35 +
33 36 static int perl_mongo_inc = 0;
34 37
35 38 int perl_mongo_machine_id;
@@ -776,9 +779,13 @@ void perl_mongo_make_id(char *id) {
776 779 unsigned t;
777 780 char *T, *M, *P, *I;
778 781
  782 +#ifdef USE_ITHREADS
779 783 MUTEX_LOCK(&inc_mutex);
  784 +#endif
780 785 inc = perl_mongo_inc++;
  786 +#ifdef USE_ITHREADS
781 787 MUTEX_UNLOCK(&inc_mutex);
  788 +#endif
782 789
783 790 t = (unsigned) time(0);
784 791

0 comments on commit e55394c

Please sign in to comment.
Something went wrong with that request. Please try again.