add init for global FullData
This commit is contained in:
+24
-2
@@ -8,8 +8,6 @@
|
||||
// terms of the GNU General Public License Version 3.0.
|
||||
// https://www.gnu.org/licenses/gpl-3.0-standalone.html
|
||||
|
||||
// package core implements the structs and other necessary resources for storing
|
||||
// and managing feeds and pages
|
||||
package core
|
||||
|
||||
import (
|
||||
@@ -110,6 +108,30 @@ func (f *Feed) Swap(i, j int) {
|
||||
f.Items[i], f.Items[j] = f.Items[j], f.Items[i]
|
||||
}
|
||||
|
||||
// Lock locks both feed and page mutexes.
|
||||
func (j *JsonData) Lock() {
|
||||
j.FeedsMu.Lock()
|
||||
j.PagesMu.Lock()
|
||||
}
|
||||
|
||||
// Unlock unlocks both feed and page mutexes.
|
||||
func (j *JsonData) Unlock() {
|
||||
j.FeedsMu.Unlock()
|
||||
j.PagesMu.Unlock()
|
||||
}
|
||||
|
||||
// RLock read-locks both feed and page mutexes.
|
||||
func (j *JsonData) RLock() {
|
||||
j.FeedsMu.RLock()
|
||||
j.PagesMu.RLock()
|
||||
}
|
||||
|
||||
// RUnlock read-unlocks both feed and page mutexes.
|
||||
func (j *JsonData) RUnlock() {
|
||||
j.FeedsMu.RUnlock()
|
||||
j.PagesMu.RUnlock()
|
||||
}
|
||||
|
||||
// PageEntry is a single item on a subscriptions page. It is used for both feeds
|
||||
// and pages.
|
||||
type PageEntry struct {
|
||||
|
||||
Reference in New Issue
Block a user