diff -r da912a45f4e6 -r 3638f33225ec jdk/src/macosx/native/sun/awt/CMenuItem.m --- a/jdk/src/macosx/native/sun/awt/CMenuItem.m Fri Jan 18 14:17:11 2013 +0400 +++ b/jdk/src/macosx/native/sun/awt/CMenuItem.m Fri Jan 18 18:17:02 2013 +0400 @@ -104,7 +104,6 @@ } - (void) setJavaLabel:(NSString *)theLabel shortcut:(NSString *)theKeyEquivalent modifierMask:(jint)modifiers { -AWT_ASSERT_NOT_APPKIT_THREAD; NSUInteger modifierMask = 0; @@ -126,8 +125,7 @@ modifierMask = JavaModifiersToNsKeyModifiers(modifiers, NO); } - [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ - AWT_ASSERT_APPKIT_THREAD; + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ [fMenuItem setKeyEquivalent:theKeyEquivalent]; [fMenuItem setKeyEquivalentModifierMask:modifierMask]; [fMenuItem setTitle:theLabel]; @@ -135,32 +133,23 @@ } - (void) setJavaImage:(NSImage *)theImage { -AWT_ASSERT_NOT_APPKIT_THREAD; - [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ - AWT_ASSERT_APPKIT_THREAD; - + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ [fMenuItem setImage:theImage]; }]; } - (void) setJavaToolTipText:(NSString *)theText { -AWT_ASSERT_NOT_APPKIT_THREAD; - [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ - AWT_ASSERT_APPKIT_THREAD; - + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ [fMenuItem setToolTip:theText]; }]; } - (void)setJavaEnabled:(BOOL) enabled { -AWT_ASSERT_NOT_APPKIT_THREAD; - [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ - AWT_ASSERT_APPKIT_THREAD; - + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ @synchronized(self) { fIsEnabled = enabled; @@ -173,7 +162,6 @@ } - (BOOL)isEnabled { - // AWT_ASSERT_ANY_THREAD; BOOL enabled = NO; @synchronized(self) { @@ -184,11 +172,8 @@ - (void)setJavaState:(BOOL)newState { -AWT_ASSERT_NOT_APPKIT_THREAD; - [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ -AWT_ASSERT_APPKIT_THREAD; - + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ [fMenuItem setState:(newState ? NSOnState : NSOffState)]; }]; }