lib/ethon/curl.rb in ethon-0.5.0 vs lib/ethon/curl.rb in ethon-0.5.1

- old
+ new

@@ -9,10 +9,12 @@ require 'ethon/curls/functions' module Ethon # FFI Wrapper module for Curl. Holds constants and required initializers. + # + # @api private module Curl extend ::FFI::Library extend Ethon::Curls::Codes extend Ethon::Curls::Options extend Ethon::Curls::Infos @@ -56,9 +58,11 @@ # This function is not thread safe. You must not call it when any other thread in # the program (i.e. a thread sharing the same memory) is running. This doesn't just # mean no other thread that is using libcurl. Because curl_global_init() calls # functions of other libraries that are similarly thread unsafe, it could conflict with # any other thread that uses these other libraries. + # + # @raise [ Ethon::Errors::GlobalInit ] If Curl.global_init fails. def init @@init_mutex.synchronize { if not @@initialized raise Errors::GlobalInit.new if Curl.global_init(GLOBAL_ALL) != 0 @@initialized = true