This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: per-surface locking for jawt


Hi,

On Wed, 2005-04-06 at 05:30 -0700, Anthony Green wrote:

> Index: jawt.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/jawt.c,v
> retrieving revision 1.2.6.1
> diff -u -r1.2.6.1 jawt.c
> --- jawt.c	7 Mar 2005 19:58:40 -0000	1.2.6.1
> +++ jawt.c	6 Apr 2005 12:12:31 -0000
> @@ -40,6 +40,7 @@
>  #include <jawt.h>
>  #include <jawt_md.h>
>  #include "classpath_jawt.h"
> +#include "jni/gtk-peer/gtkpeer.h"
>  
>  static jint (JNICALL _Jv_Lock) (JAWT_DrawingSurface* surface);
>  static void (JNICALL _Jv_Unlock) (JAWT_DrawingSurface* surface);
> @@ -76,14 +77,16 @@
>  static jint
>  (JNICALL _Jv_Lock) (JAWT_DrawingSurface* surface)
>  {
> -  /* lock the drawing surface */
> -  return classpath_jawt_lock ();
> +  JNIEnv *env = gdk_env();
> +  (*env)->MonitorEnter (env, surface->lock);
> +  return 0;
>  }

Instead of introducing GTK-specific code in jawt.c can you add new
surface lock and unlock functions to jni/classpath/classpath_jawt.h and
jni/gtk-peer/gtk_jawt.c?  The idea is to keep jawt.c peer-neutral and
have peer sets that want to implement the AWT Native Interface implement
the functions declared in classpath_jawt.h.

Tom



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]