-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4141 from remotion-dev/dont-use-threadpool-with-1…
…-thread
- Loading branch information
Showing
3 changed files
with
92 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use lazy_static::lazy_static; | ||
use std::sync::Mutex; | ||
|
||
pub struct MaxCacheSize { | ||
value: Option<u128>, | ||
} | ||
|
||
impl MaxCacheSize { | ||
// Private constructor | ||
fn new() -> Self { | ||
MaxCacheSize { value: None } | ||
} | ||
|
||
// Getter for the value | ||
pub fn get_value(&self) -> Option<u128> { | ||
self.value | ||
} | ||
|
||
// Setter for the value | ||
pub fn set_value(&mut self, value: Option<u128>) { | ||
self.value = value; | ||
} | ||
} | ||
|
||
// Global static instance of MaxCacheSize | ||
lazy_static! { | ||
static ref INSTANCE: Mutex<MaxCacheSize> = Mutex::new(MaxCacheSize::new()); | ||
} | ||
|
||
// Function to access the global singleton instance | ||
pub fn get_instance() -> &'static Mutex<MaxCacheSize> { | ||
&INSTANCE | ||
} |