mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Utilize re-entrant locking for in app payments instead of synchronized blocks.
This commit is contained in:
committed by
Greyson Parrelli
parent
a79b4c3ba0
commit
ed24fd0c4b
@@ -9,6 +9,8 @@ import org.signal.donations.InAppPaymentType
|
||||
import org.thoughtcrime.securesms.database.model.databaseprotos.InAppPaymentData
|
||||
import org.whispersystems.signalservice.api.subscriptions.SubscriberId
|
||||
import java.util.Currency
|
||||
import java.util.concurrent.locks.Lock
|
||||
import java.util.concurrent.locks.ReentrantLock
|
||||
|
||||
/**
|
||||
* Represents a SubscriberId and metadata that can be used for a recurring
|
||||
@@ -24,7 +26,7 @@ data class InAppPaymentSubscriberRecord(
|
||||
/**
|
||||
* Serves as the mutex by which to perform mutations to subscriptions.
|
||||
*/
|
||||
enum class Type(val code: Int, val jobQueue: String, val inAppPaymentType: InAppPaymentType) {
|
||||
enum class Type(val code: Int, val jobQueue: String, val inAppPaymentType: InAppPaymentType, val lock: Lock = ReentrantLock()) {
|
||||
/**
|
||||
* A recurring donation
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user