Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:52:18+00:00 2026-06-10T10:52:18+00:00

I am modifying a library which is entirely reentrant to add windows support. The

  • 0

I am modifying a library which is entirely reentrant to add windows support. The problem is the initialization function. The initialization function is wrapped in MUTEX_LOCK(&ssl_lock); and MUTEX_UNLOCK(&ssl_lock); in order to garuntee that everything is initalized only once.

The problem is that I cannot call EnterCriticalSection before InitializeCriticalSection and InitializeCriticalSection is not reentrant. How do I solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:52:19+00:00Added an answer on June 10, 2026 at 10:52 am

    Depending on what version sof Windows you need to support, you can use the “Init Once” APIs:

    • One-Time Initialization MSDN Documentation
    • Patterns for using the InitOnce functions

    If you need to support WinXP/Win Server 2003 or older, you may need to rely on a Mutex object that the kernel can ensure only gets created once. You’ll need to implement some logic when opening/creating the mutex to make sure all threads of execution end up with a valid handle (ie., a loop that attempts to open, then attempts to create until the open or create succeeds).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a static library which (among other things) implements a tiny function that
I am modifying a core function of the Kohana library, the text::auto_p() function. The
I have a textfile which my Java program is modifying and putting into an
Most programing languages have 'include library into your code' function but where is function
I am creating a webpage which needs to pull in a Javascript library which
I have a Qt/C++ acpplication which is using a C++ library. This library has
Please, sorry for the long text. I have a library of C# Classes which
I have several modifying threads and some reading threads, which all access the global
I've encountered a problem in Visual Studio 2008 where recompiling a library project has
I am creating a project which uses JFreeChart library which is licensed under LGPL.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.