Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
2026-04-28 Hendrik Huebner <hendrik.huebner@algoriddim.com>

* Source/NSOperation.m: Added libdispatch based NSOperationQueue
implementation (Enabled by default for platforms where libdispatch
is available).
* Headers/Foundation/NSOperation.h: Exposed underlyingQueue getter
and setter for platforms using libdispatch.
* Tests/base/NSOperation/queue_dispatch.m:
Added tests for underlying queue and dispatch implementation.
* Tests/base/NSOperation/GNUmakefile.preamble: Link libdispatch to
queue_dispatch.m.

2026-04-27 Richard Frith-Macdonald <rfm@gnu.org>

* configure.ac: Add test for res_nquery()
Expand Down
25 changes: 23 additions & 2 deletions Headers/Foundation/NSOperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@
#ifndef __NSOperation_h_GNUSTEP_BASE_INCLUDE
#define __NSOperation_h_GNUSTEP_BASE_INCLUDE

#include "GNUstepBase/GSConfig.h"
#import <Foundation/NSObject.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)


#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST) \
&& GS_USE_LIBDISPATCH == 1
#include "dispatch/dispatch.h"
#endif

#if defined(__cplusplus)
extern "C" {
#endif
Expand Down Expand Up @@ -334,9 +341,23 @@ GS_EXPORT_CLASS
* and removed from the queue).
*/
- (void) waitUntilAllOperationsAreFinished;
@end


#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST) \
&& GS_USE_LIBDISPATCH == 1
/** Returns the underlying dispatch queue.
*/
- (dispatch_queue_t) underlyingQueue;

/** Sets the underlying dispatch queue.
*
* Throws `NSInvalidArgumentException` if:
* - The argument is `NULL`
* - There are operations in the queue `(operationCount > 0)`
* - The argument is the value returned by `dispatch_get_main_queue()`
*/
- (void) setUnderlyingQueue: (dispatch_queue_t)dispatchQueue;
#endif
@end

#if defined(__cplusplus)
}
Expand Down
Loading
Loading