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

Raw.xs: Enable libgit2 threads #74

Closed
wants to merge 1 commit into from
Closed

Raw.xs: Enable libgit2 threads #74

wants to merge 1 commit into from

Conversation

jacquesg
Copy link
Owner

This PR enables the threading support in libgit2.

@jacquesg
Copy link
Owner Author

@ghedo I've managed to get the threading system to start up properly by putting the necessary code into a BEGIN block.

Calling the shutdown function I couldn't get to work, seems like END gets called multiple times. Do you maybe know how to solve this?

@ghedo
Copy link
Collaborator

ghedo commented Apr 16, 2014

The init should go into the BOOT XS section. As for the cleanup, I don't know, but AFAICT XSLoader doesn't actually "unload" an XS module, so it's probably not a big deal.

Also, I'm a bit worried about non-threaded perls (I've had troubles in the past on OpenBSD due to pthreads)., so if $Config{usethreads} is false this should probably be disable as well.

@jacquesg
Copy link
Owner Author

Ok, I had it in BOOT originally, but moved it to INIT as I thought there would be a symmetric way of doing it, will move it back :)

I'l also had a check for $Config{usethreads}.

@jacquesg
Copy link
Owner Author

Is this what you had in mind?

@ghedo
Copy link
Collaborator

ghedo commented Apr 17, 2014

Not quite. I meant that if $Config{usethreads} is false, GIT_THREADS shouldn't be defined at all. Without threading support in perl there's really no point in enabling threading in libgit2.

Also, why not enable this on windows too? AFAICT libgit2 supports it. We'd probably need to add -DGIT_WIN32 to MakeMaker.pm (I wonder why Makefile.embed doesn't do this though).

@jacquesg
Copy link
Owner Author

Haven't added the windows support yet, as it seems to be tailored towards a cygwin/mingw environment, so its quite hard to verify that it actually works.

@jacquesg
Copy link
Owner Author

Ok, I've enabled it for Windows, should probably be fine. Also added the GIT_WIN32 define. I don't know how well the Makefile.embed is actually maintained.

@ghedo
Copy link
Collaborator

ghedo commented Apr 17, 2014

Merged, thanks!

@ghedo ghedo closed this Apr 17, 2014
@jacquesg jacquesg deleted the threads branch April 25, 2014 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants