Skip to content

Commit

Permalink
windows: hack to get around golang/go#55015
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Sep 17, 2023
1 parent 2a67aea commit 8f4a230
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions adapter_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bluetooth

import (
"fmt"
"time"

"github.com/go-ole/go-ole"
"github.com/saltosystems/winrt-go"
Expand All @@ -27,6 +28,11 @@ var DefaultAdapter = &Adapter{
// Enable configures the BLE stack. It must be called before any
// Bluetooth-related calls (unless otherwise indicated).
func (a *Adapter) Enable() error {
// hack to get around https://github.com/golang/go/issues/55015
go func() {
<-time.After(24 * 365 * time.Hour)
}()

return ole.RoInitialize(1) // initialize with multithreading enabled
}

Expand Down

0 comments on commit 8f4a230

Please sign in to comment.