Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • orc orc
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 14
    • Issues 14
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamerGStreamer
  • orcorc
  • Issues
  • #10
Closed
Open
Issue created Aug 24, 2015 by Bugzilla Migration User@bugzilla-migration

Don't use C constructors for initializing critical sections on Windows

Submitted by Nirbheek Chauhan @nirbheek

Link to original bug (#754027)

Description

Created attachment 309924
Don't use C constructors for initializing critical sections on Windows

Instead, use memory barriers and just initialize it as part of orc_init().
Also, require that some sort of threading library be available.

C constructors are toolchain-specific which brings its own set of problems.
There's no guarantees about the order in which C constructors are called, it
makes it impossible to use static libraries built with one toolchain on another
one, and so on.

Finally, C constructors are only useful when you need a single point of entry
for initializing data shared throughout the library. Orc already has a function
for doing that; namely orc_init(), so we can just use that.

The atomic set/get of cs_inited using MemoryBarrier() was inspired by GLib's
g_atomic_int_set/get implementation.

Patch 309924, "Don't use C constructors for initializing critical sections on Windows":
0001-orc-Don-t-use-C-constructors-for-initializing-critic.patch

Assignee
Assign to
Time tracking