author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 30 Apr 2008 08:59:19 +0000 (10:59 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 30 Apr 2008 08:59:19 +0000 (10:59 +0200) |
Conflicts:
configure.in
src/perl.c
configure.in
src/perl.c
1 | 2 | |||
---|---|---|---|---|
configure.in | patch | | diff1 | | diff2 | | blob | history |
src/perl.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc configure.in
Simple merge
diff --cc src/perl.c
index 96e85622445da09a7b9ad8deae514e215d279e6f,68d6ddcff9e8b1cc1ca87b1f01798abf2bd4d6f7..877bc00805cc0e5f78a09d2a03bc02ae0682e30d
--- 1/src/perl.c
--- 2/src/perl.c
+++ b/src/perl.c
}
#endif /* COLLECT_DEBUG */
+ if (0 != pthread_key_create (&perl_thr_key, c_ithread_destructor)) {
+ log_err ("init_pi: pthread_key_create failed");
+
+ /* this must not happen - cowardly giving up if it does */
+ exit (1);
+ }
+
+ #ifdef __FreeBSD__
+ /* On FreeBSD, PERL_SYS_INIT3 expands to some expression which
+ * triggers a "value computed is not used" warning by gcc. */
+ (void)
+ #endif
PERL_SYS_INIT3 (&argc, &argv, &environ);
- if (NULL == (perl = perl_alloc ())) {
- log_err ("module_register: Not enough memory.");
+ perl_threads = (c_ithread_list_t *)smalloc (sizeof (c_ithread_list_t));
+ memset (perl_threads, 0, sizeof (c_ithread_list_t));
+
+ pthread_mutex_init (&perl_threads->mutex, NULL);
+ /* locking the mutex should not be necessary at this point
+ * but let's just do it for the sake of completeness */
+ pthread_mutex_lock (&perl_threads->mutex);
+
+ perl_threads->head = c_ithread_create (NULL);
+ perl_threads->tail = perl_threads->head;
+
+ if (NULL == (perl_threads->head->interp = perl_alloc ())) {
+ log_err ("init_pi: Not enough memory.");
exit (3);
}
- perl_construct (perl);
+
+ aTHX = perl_threads->head->interp;
+ pthread_mutex_unlock (&perl_threads->mutex);
+
+ perl_construct (aTHX);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;