2014-05-09 01:23:54 +00:00
|
|
|
// Copyright 2014 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
|
|
|
#ifndef APP_LIBCRYPTO_THREADING_H_
|
|
|
|
#define APP_LIBCRYPTO_THREADING_H_
|
|
|
|
|
2014-10-01 22:10:21 +00:00
|
|
|
#include "packager/base/macros.h"
|
2014-05-09 01:23:54 +00:00
|
|
|
|
2014-09-19 20:41:13 +00:00
|
|
|
namespace edash_packager {
|
2014-05-09 01:23:54 +00:00
|
|
|
namespace media {
|
|
|
|
|
|
|
|
/// Enable thread safety for OpenSSL libcrypto.
|
|
|
|
/// @return true if successful, false otherwise.
|
|
|
|
bool InitLibcryptoThreading();
|
|
|
|
|
|
|
|
/// Terminate thread safety for OpenSSL libcrypto.
|
|
|
|
/// @return true if successful, false otherwise.
|
|
|
|
bool TerminateLibcryptoThreading();
|
|
|
|
|
|
|
|
/// Convenience class which initializes and terminates libcrypto threading.
|
|
|
|
class LibcryptoThreading {
|
|
|
|
public:
|
|
|
|
LibcryptoThreading();
|
|
|
|
~LibcryptoThreading();
|
|
|
|
|
|
|
|
/// Enables thread safety for OpenSSL libcrypto.
|
|
|
|
/// @return true if successful, false otherwise.
|
|
|
|
bool Initialize();
|
|
|
|
|
|
|
|
private:
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(LibcryptoThreading);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace media
|
2014-09-19 20:41:13 +00:00
|
|
|
} // namespace edash_packager
|
2014-05-09 01:23:54 +00:00
|
|
|
|
|
|
|
#endif // APP_LIBCRYPTO_THREADING_H_
|