Ruslan Osmanov avatar Ruslan Osmanov committed cc92a27

Turn off buggy libevent lock debugging

Comments (0)

Files changed (2)

examples/timer.php

 <?php
 $base = new EventBase();
 $e = new Event($base, -1, Event::TIMEOUT, function($fd, $what, $e) {
-	echo "2 seconds elapsed\n";
-	$e->delTimer();
+	echo "1 seconds elapsed\n";
+	//$e->delTimer();
 });
 $e->data = $e;
-$e->addTimer(2);
+$e->addTimer(1);
 $base->loop();
 ?>
     php_event_ssl_data_index = SSL_get_ex_new_index(0, "PHP EventSslContext index", NULL, NULL, NULL);
 #endif /* HAVE_EVENT_OPENSSL_LIB */
 
+
+#ifdef PHP_EVENT_DEBUG
+	event_enable_debug_mode();
+#endif
+
 #ifdef HAVE_EVENT_PTHREADS_LIB
 # ifdef WIN32
 # error "Windows is not supported right now"
 	evthread_use_windows_threads();
 # else
-	evthread_use_pthreads();
+	PHP_EVENT_ASSERT(evthread_use_pthreads() == 0);
 # endif
 #endif
 
 	event_set_fatal_callback(fatal_error_cb);
 	event_set_log_callback(log_cb);
 
-#ifdef PHP_EVENT_DEBUG
-	event_enable_debug_mode();
-# ifdef HAVE_EVENT_PTHREADS_LIB
-	evthread_enable_lock_debuging();
-# endif
-#endif
-
 	return SUCCESS;
 }
 /* }}} */
 /* {{{ PHP_MSHUTDOWN_FUNCTION */
 PHP_MSHUTDOWN_FUNCTION(event)
 {
-	zend_hash_destroy(&event_properties);
-	zend_hash_destroy(&event_bevent_properties);
-	zend_hash_destroy(&event_buffer_properties);
-	zend_hash_destroy(&event_buffer_pos_properties);
-	zend_hash_destroy(&event_ssl_context_properties);
-
-	zend_hash_destroy(&classes);
-
 #ifdef HAVE_EVENT_OPENSSL_LIB
 	/* Removes memory allocated when loading digest and cipher names
 	 * in the OpenSSL_add_all_ family of functions */
 	libevent_global_shutdown();
 #endif
 
+	zend_hash_destroy(&event_properties);
+	zend_hash_destroy(&event_bevent_properties);
+	zend_hash_destroy(&event_buffer_properties);
+	zend_hash_destroy(&event_buffer_pos_properties);
+	zend_hash_destroy(&event_ssl_context_properties);
+
+	zend_hash_destroy(&classes);
+
 	return SUCCESS;
 }
 /* }}} */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.