ObjFW  Check-in [e959c99f85]

Overview
Comment:Add -[performSelectorOnMainThread:waitUntilDone:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e959c99f85ee1eff125e265aeaf5483c39eff256a1911aade6c577907cd1ac0f
User & Date: js on 2012-09-17 10:18:11
Other Links: manifest | tags
Context
2012-09-17
15:48
Add -[asyncReadIntoBuffer:exactLength:block:]. check-in: be6adc6e06 user: js tags: trunk
10:18
Add -[performSelectorOnMainThread:waitUntilDone:]. check-in: e959c99f85 user: js tags: trunk
10:11
OFTimer: Fix -[initWith...block:]. check-in: 1550e4988b user: js tags: trunk
Changes

Modified src/OFObject.h from [c83f58337e] to [171eb78051].

677
678
679
680
681
682
683






































684
685
686
687
688
689
690
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (id)object1
	     withObject: (id)object2
	  waitUntilDone: (BOOL)waitUntilDone;







































/**
 * \brief Performs the specified selector on the specified thread after the
 *	  specified delay.
 *
 * \param selector The selector to perform
 * \param thread The thread on which to perform the selector
 * \param delay The delay after which the selector will be performed







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (id)object1
	     withObject: (id)object2
	  waitUntilDone: (BOOL)waitUntilDone;

/**
 * \brief Performs the specified selector on the main thread.
 *
 * \param selector The selector to perform
 * \param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelectorOnMainThread: (SEL)selector
		      waitUntilDone: (BOOL)waitUntilDone;

/**
 * \brief Performs the specified selector on the main thread with the specified
 *	  object.
 *
 * \param selector The selector to perform
 * \param object The object that is passed to the method specified by the
 *		 selector
 * \param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelectorOnMainThread: (SEL)selector
			 withObject: (id)object
		      waitUntilDone: (BOOL)waitUntilDone;

/**
 * \brief Performs the specified selector on the main thread with the specified
 *	  objects.
 *
 * \param selector The selector to perform
 * \param object1 The first object that is passed to the method specified by the
 *		 selector
 * \param object2 The second object that is passed to the method specified by
 *		  the selector
 * \param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelectorOnMainThread: (SEL)selector
			 withObject: (id)object1
			 withObject: (id)object2
		      waitUntilDone: (BOOL)waitUntilDone;

/**
 * \brief Performs the specified selector on the specified thread after the
 *	  specified delay.
 *
 * \param selector The selector to perform
 * \param thread The thread on which to perform the selector
 * \param delay The delay after which the selector will be performed

Modified src/OFObject.m from [13e68b8637] to [36829d1a67].

673
674
675
676
677
678
679






















































680
681
682
683
684
685
686
						 target: self
					       selector: selector
						 object: object1
						 object: object2
						repeats: NO];
	[[thread runLoop] addTimer: timer];























































	if (waitUntilDone)
		[timer waitUntilDone];

	objc_autoreleasePoolPop(pool);
}

- (void)performSelector: (SEL)selector







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
						 target: self
					       selector: selector
						 object: object1
						 object: object2
						repeats: NO];
	[[thread runLoop] addTimer: timer];

	if (waitUntilDone)
		[timer waitUntilDone];

	objc_autoreleasePoolPop(pool);
}

- (void)performSelectorOnMainThread: (SEL)selector
		      waitUntilDone: (BOOL)waitUntilDone
{
	void *pool = objc_autoreleasePoolPush();
	OFTimer *timer = [OFTimer timerWithTimeInterval: 0
						 target: self
					       selector: selector
						repeats: NO];
	[[OFRunLoop mainRunLoop] addTimer: timer];

	if (waitUntilDone)
		[timer waitUntilDone];

	objc_autoreleasePoolPop(pool);
}

- (void)performSelectorOnMainThread: (SEL)selector
			 withObject: (id)object
		      waitUntilDone: (BOOL)waitUntilDone
{
	void *pool = objc_autoreleasePoolPush();
	OFTimer *timer = [OFTimer timerWithTimeInterval: 0
						 target: self
					       selector: selector
						 object: object
						repeats: NO];
	[[OFRunLoop mainRunLoop] addTimer: timer];

	if (waitUntilDone)
		[timer waitUntilDone];

	objc_autoreleasePoolPop(pool);
}

- (void)performSelectorOnMainThread: (SEL)selector
			 withObject: (id)object1
			 withObject: (id)object2
		      waitUntilDone: (BOOL)waitUntilDone
{
	void *pool = objc_autoreleasePoolPush();
	OFTimer *timer = [OFTimer timerWithTimeInterval: 0
						 target: self
					       selector: selector
						 object: object1
						 object: object2
						repeats: NO];
	[[OFRunLoop mainRunLoop] addTimer: timer];

	if (waitUntilDone)
		[timer waitUntilDone];

	objc_autoreleasePoolPop(pool);
}

- (void)performSelector: (SEL)selector