Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[native_synchronization] update pubspec metadata for the repo move #5

Merged
merged 1 commit into from
Sep 27, 2024
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This repository is home to various Dart packages under the

| Package | Description | Version |
|---|---|---|
| [native_synchronization](pkgs/native_synchronization/) | Low level synchronization primitives built on dart:ffi. | [![pub package](https://img.shields.io/pub/v/native_synchronization.svg)](https://pub.dev/packages/native_synchronization) |

## Publishing automation

Expand Down
4 changes: 4 additions & 0 deletions pkgs/native_synchronization/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.1

- Update the pubspec repository field to reflect the repo move.

## 0.3.0

- Add a closed state to `Mailbox`.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/native_synchronization/lib/mailbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import 'dart:typed_data';

import 'package:ffi/ffi.dart';

import 'package:native_synchronization/primitives.dart';
import 'package:native_synchronization/sendable.dart';
import 'primitives.dart';
import 'sendable.dart';

final class _MailboxRepr extends Struct {
external Pointer<Uint8> buffer;
Expand Down
6 changes: 3 additions & 3 deletions pkgs/native_synchronization/lib/primitives.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import 'dart:ffi';
import 'dart:io';

import 'package:ffi/ffi.dart';
import 'package:native_synchronization/sendable.dart';

import 'package:native_synchronization/src/bindings/pthread.dart';
import 'package:native_synchronization/src/bindings/winapi.dart';
import 'sendable.dart';
import 'src/bindings/pthread.dart';
import 'src/bindings/winapi.dart';

part 'posix.dart';
part 'windows.dart';
Expand Down
6 changes: 3 additions & 3 deletions pkgs/native_synchronization/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: native_synchronization
description: Low level synchronization primitives built on dart:ffi.
version: 0.3.0
repository: https://github.com/dart-lang/native_synchronization
version: 0.3.1
repository: https://github.com/dart-lang/labs/tree/main/pkgs/native_synchronization

environment:
sdk: ">=3.0.0 <4.0.0"
Expand All @@ -10,5 +10,5 @@ dependencies:
ffi: ^2.1.0

dev_dependencies:
dart_flutter_team_lints: ^1.0.0
dart_flutter_team_lints: ^3.0.0
test: ^1.16.0
8 changes: 4 additions & 4 deletions pkgs/native_synchronization/test/primitives_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ void main() {
final mutex = sendableMutex.materialize();

while (true) {
sleep(Duration(milliseconds: 10));
sleep(const Duration(milliseconds: 10));
if (mutex.runLocked(() {
if (ptr.value == 2) {
return true;
}
ptr.value = 0;
sleep(Duration(milliseconds: 500));
sleep(const Duration(milliseconds: 500));
ptr.value = 1;
return false;
})) {
Expand Down Expand Up @@ -61,7 +61,7 @@ void main() {
})) {
break;
}
await Future.delayed(const Duration(milliseconds: 10));
await Future<void>.delayed(const Duration(milliseconds: 10));
}
expect(await helperResult, equals('success'));
});
Expand Down Expand Up @@ -109,7 +109,7 @@ void main() {
if (success) {
break;
}
await Future.delayed(const Duration(milliseconds: 20));
await Future<void>.delayed(const Duration(milliseconds: 20));
}

expect(await helperResult, equals('success'));
Expand Down