diff options
| author | Sam Ruby <rubys@php.net> | 2000-08-04 18:39:47 +0000 | 
|---|---|---|
| committer | Sam Ruby <rubys@php.net> | 2000-08-04 18:39:47 +0000 | 
| commit | 3da910ae24e86a89ca9d17bacbb97080c42bacfd (patch) | |
| tree | 495ef74501db703eba51fd61af38e33c69a6bcd1 /ext/java/java.c | |
| parent | 7b388964ee2e67c0522954ef878529fa0e88bcd5 (diff) | |
| download | php-git-3da910ae24e86a89ca9d17bacbb97080c42bacfd.tar.gz | |
Restore the ability to clean compile in non-multithreaded environments
Diffstat (limited to 'ext/java/java.c')
| -rw-r--r-- | ext/java/java.c | 36 | 
1 files changed, 20 insertions, 16 deletions
| diff --git a/ext/java/java.c b/ext/java/java.c index 2157f30dd9..45d8be82b0 100644 --- a/ext/java/java.c +++ b/ext/java/java.c @@ -94,7 +94,7 @@ int java_globals_id;  #define JG_DC  #define JG_C  #define JG_CC -php_java_globals javadir_globals; +php_java_globals java_globals;  #endif  static zend_class_entry java_class_entry; @@ -159,8 +159,6 @@ static void addJVMOption(JavaVMInitArgs *vm_args, char *name, char *value) {  #endif  static int jvm_create() { -  JG_FETCH(); -    int rc;    jobject local_php_reflect;    jthrowable error; @@ -179,6 +177,8 @@ static int jvm_create() {  #endif  #endif +  JG_FETCH(); +    iniUpdated=0;    if (javalib) { @@ -410,7 +410,6 @@ static int checkError(pval *value) {  void java_call_function_handler    (INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)  { -  JG_FETCH();    JNIEnv *jenv;    pval *object = property_reference->object; @@ -419,8 +418,10 @@ void java_call_function_handler    int arg_count = ZEND_NUM_ARGS();    jlong result = 0; -    pval **arguments = (pval **) emalloc(sizeof(pval *)*arg_count); + +  JG_FETCH(); +    getParametersArray(ht, arg_count, arguments);    if (iniUpdated && JG(jenv)) jvm_destroy(); @@ -483,11 +484,11 @@ void java_call_function_handler  PHP_FUNCTION(java_last_exception_get)  { -  JG_FETCH(); -    jlong result = 0;    jmethodID lastEx; +  JG_FETCH(); +    if (ZEND_NUM_ARGS()!=0) WRONG_PARAM_COUNT;    (pval*)(long)result = return_value; @@ -502,11 +503,11 @@ PHP_FUNCTION(java_last_exception_get)  PHP_FUNCTION(java_last_exception_clear)  { -  JG_FETCH(); -    jlong result = 0;    jmethodID clearEx; +  JG_FETCH(); +    if (ZEND_NUM_ARGS()!=0) WRONG_PARAM_COUNT;    (pval*)(long)result = return_value; @@ -522,9 +523,6 @@ PHP_FUNCTION(java_last_exception_clear)  static pval _java_getset_property    (zend_property_reference *property_reference, jobjectArray value)  { -  JG_FETCH(); -  JNIEnv *jenv = JG(jenv); -    pval presult;    jlong result = 0;    pval **pobject; @@ -534,8 +532,13 @@ static pval _java_getset_property    /* get the property name */    zend_llist_element *element = property_reference->elements_list->head;    zend_overloaded_element *property=(zend_overloaded_element *)element->data; -  jstring propName = -    (*jenv)->NewStringUTF(jenv, property->element.value.str.val); +  jstring propName; + +  JNIEnv *jenv; +  JG_FETCH();  +  jenv = JG(jenv); + +  propName = (*jenv)->NewStringUTF(jenv, property->element.value.str.val);    /* get the object */    zend_hash_index_find(property_reference->object->value.obj.properties, @@ -572,8 +575,9 @@ pval java_get_property_handler  int java_set_property_handler    (zend_property_reference *property_reference, pval *value)  { +  pval presult;    JG_FETCH(); -  pval presult = _java_getset_property +  presult = _java_getset_property      (property_reference, _java_makeArray(1, &value JG_CC));    return checkError(&presult) ? FAILURE : SUCCESS;  } @@ -767,8 +771,8 @@ JNIEXPORT void JNICALL Java_net_php_reflect_setException  JNIEXPORT void JNICALL Java_net_php_reflect_setEnv    (JNIEnv *newJenv, jclass self)  { -  JG_FETCH();    jobject local_php_reflect; +  JG_FETCH();    iniUpdated=0;    JG(jenv)=newJenv; | 
