43 |
private static Thread mainThread = null; |
private static Thread mainThread = null; |
44 |
private static Object mainThreadLock = new Object(); |
private static Object mainThreadLock = new Object(); |
45 |
|
|
46 |
|
// Whether the gtk+ subsystem has been initialized. |
47 |
|
private boolean gtkInitCalled = false; |
48 |
|
|
49 |
/** |
/** |
50 |
* Call gtk_init. It is very important that this happen before any other |
* Call gtk_init. It is very important that this happen before any other |
51 |
* gtk calls. |
* gtk calls. |
70 |
synchronized (this) |
synchronized (this) |
71 |
{ |
{ |
72 |
mainThread.start(); |
mainThread.start(); |
73 |
try { |
|
74 |
wait(); |
while (!gtkInitCalled) |
75 |
} catch (InterruptedException e) { } |
{ |
76 |
|
try |
77 |
|
{ |
78 |
|
wait(); |
79 |
|
} |
80 |
|
catch (InterruptedException e) { } |
81 |
|
} |
82 |
} |
} |
83 |
} |
} |
84 |
|
|
100 |
synchronized (this) |
synchronized (this) |
101 |
{ |
{ |
102 |
gtkInit(portableNativeSync); |
gtkInit(portableNativeSync); |
103 |
notify(); |
gtkInitCalled = true; |
104 |
|
notifyAll(); |
105 |
} |
} |
106 |
gtkMain(); |
gtkMain(); |
107 |
} |
} |