GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Suppress sendability warnings on single-threaded platform · sakrist/JavaScriptKit@5b79ddf

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Sources/JavaScriptKit
    • ThreadLocal.swift
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Sources/JavaScriptKit/ThreadLocal.swift‎

Copy file name to clipboardExpand all lines: Sources/JavaScriptKit/ThreadLocal.swift
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ final class ThreadLocal<Value>: Sendable {
7878
}
7979
#else
8080
// Fallback implementation for platforms that don't support pthread
81-
#if compiler(>=5.10)
82-
nonisolated(unsafe) var wrappedValue: Value?
83-
#else
84-
var wrappedValue: Value?
85-
#endif
81+
private class SendableBox: @unchecked Sendable {
82+
var value: Value? = nil
83+
}
84+
private let _storage = SendableBox()
85+
var wrappedValue: Value? {
86+
get { _storage.value }
87+
set { _storage.value = newValue }
88+
}
8689

8790
init() where Value: AnyObject {
8891
wrappedValue = nil

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.