Skip to content

Commit

Permalink
handle process command differences between windows and unix. run form…
Browse files Browse the repository at this point in the history
…atter.
  • Loading branch information
JonathanHenson committed Nov 2, 2023
1 parent 44957ff commit 3101481
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 7 additions & 5 deletions include/aws/common/ipc_util.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef AWS_COMMON_IPC_UTIL_H
#define AWS_COMMON_IPC_UTIL_H
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/common/common.h>
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/common/byte_buf.h>
#include <aws/common/common.h>

struct aws_ipc_util_instance_lock;
AWS_EXTERN_C_BEGIN
Expand All @@ -19,7 +19,9 @@ AWS_EXTERN_C_BEGIN
* If the process exits before the lock is released, the kernel will unlock it for the next consumer.
*/
AWS_COMMON_API
struct aws_ipc_util_instance_lock *aws_ipc_util_instance_lock_try_acquire(struct aws_allocator *allocator, struct aws_byte_cursor instance_nonce);
struct aws_ipc_util_instance_lock *aws_ipc_util_instance_lock_try_acquire(
struct aws_allocator *allocator,
struct aws_byte_cursor instance_nonce);

/**
* Releases the lock so the next caller (may be another process) can get an instance of the lock.
Expand Down
4 changes: 4 additions & 0 deletions tests/io_util_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ static int s_test_instance_lock_works_cross_proc(struct aws_allocator *allocator

/* Invoke the test runner in a new process for ease so cmake automatically does the work for us. */
struct aws_run_command_options command_options = {
#ifdef __WIN32
.command = "aws-c-common-tests instance_lock_mp_test_runner",
#else
.command = "./aws-c-common-tests instance_lock_mp_test_runner",
#endif
};

struct aws_run_command_result result;
Expand Down

0 comments on commit 3101481

Please sign in to comment.